建立ASP。NET 4.5没有Visual Studio在构建服务器上。

时间:2021-04-21 03:35:59

Its been a while since I setup a Build Server so maybe I've forgotten something or maybe .NET 4.5 is different from whatever version I did this with last time, but here is my problem.

自从我安装了一个构建服务器已经有一段时间了,所以可能我忘记了一些东西或者。net 4.5和我上次做的版本不一样,但是这是我的问题。

I'm trying to setup a build server to monitor a source control repository. Whenever something changes, I want the server to pull the changes and build the project. If there are no errors, I want to deploy the site to a web site running on the build server.

我正在尝试设置一个构建服务器来监视源控制存储库。每当发生变化时,我都希望服务器提取变化并构建项目。如果没有错误,我希望将站点部署到运行在构建服务器上的web站点。

In the past when I did this, I thought that I was able to do this having only .NET installed, but when I try to build this project I get an error that "C:\Program Files\MSBuild\Microsoft\VisualStudio\v11.0\WebApplications\Microsoft.WebApplication.targets" is missing, and if I go and look I can see that it is missing. In fact there are no Visual Studio 11 targets files.

在过去,当我这样做的时候,我认为我只安装了。net,但是当我尝试构建这个项目时,我得到了一个错误,“C:\程序文件\MSBuild\Microsoft\VisualStudio v11.0\WebApplications, Microsoft.WebApplication”。目标“是缺失的,如果我去看,我可以看到它是缺失的。事实上,没有Visual Studio 11目标文件。

After a lot of thought and head scratching, I went out and got the "Windows 8/.NET 4.5 SDK" thinking that the .NET 4.5 SDK might install the targets files that I needed, but it did not unless I installed it wrong somehow.

经过一番思考和挠头,我走了出去,拿到了“Windows 8/”。NET 4.5 SDK“认为。NET 4.5 SDK可能会安装我需要的目标文件,但它没有安装,除非我安装错误。

So, what do I need to put on the Build Server in order to get the project to build. I would prefer not to have to install the full Visual Studio 2012.

因此,我需要在构建服务器上安装什么才能让项目构建起来。我宁愿不需要安装完整的Visual Studio 2012。

6 个解决方案

#1


34  

My problem was related to installing the Windows Software Development Kit (SDK) for Windows 8 on a Windows 2008 Box. If you read further on the page, you will get to a heading labeled ".NET Framework 4.5 SDK Tools on Windows Vista and Windows Server 2008." This tells you to:

我的问题是在Windows 2008机顶盒上安装Windows 8软件开发工具包(SDK)。如果你在这一页上再读下去,你会看到一个标题,上面写着“”。NET Framework 4.5 SDK工具,适用于Windows Vista和Windows Server 2008。这告诉你:

  1. Run the Windows SDK for Windows 8 installer on a supported operating system (for example, Windows 7, or Windows 8).
  2. 在受支持的操作系统上运行Windows 8安装程序的Windows SDK(例如,Windows 7或Windows 8)。
  3. Choose the following option on the Specify Location screen: Download the Windows SDK for installation on a separate computer.
  4. 在指定位置屏幕上选择以下选项:下载Windows SDK,安装在单独的计算机上。
  5. Press the Next button.
  6. 按下一个按钮。
  7. Answer the questions on the Join the Customer Experience Improvement Program (CEIP) screen.
  8. 在“加入客户体验改进计划”(CEIP)屏幕上回答问题。
  9. On the next screen, choose the .NET Framework 4.5 Software Development Kit feature. Unselect all other features that can be unselected.
  10. 在下一个屏幕上,选择。net Framework 4.5 Software Development Kit特性。取消选择所有可能未被选中的其他功能。
  11. Choose the Download button.
  12. 选择下载按钮。
  13. Go to the download location (specified in step 2) and find the following .NET Framework 4.5 SDK tool installer files: sdk_tools4.msi, sdk_tools4.cab
  14. 转到下载位置(在步骤2中指定),找到以下。net Framework 4.5 SDK工具安装程序文件:sdk_tools4。msi,sdk_tools4.cab
  15. You can copy these files to a Windows Vista or Windows 2008 Server computer within your organization. These files need to be copied to same directory on the Windows Vista or Windows 2008 Server computer. Note: Do not redistribute these files outside your organization or as part of any other installer.
  16. 您可以将这些文件复制到您的组织内的Windows Vista或Windows 2008服务器计算机上。这些文件需要复制到Windows Vista或Windows 2008服务器上的同一目录。注意:不要在组织之外或作为任何其他安装程序的一部分重新分发这些文件。
  17. On the Windows Vista or Windows 2008 Server computer, review the license terms here .
  18. 在Windows Vista或Windows 2008服务器上,请查看这里的许可条款。
  19. Check whether .NET Framework 4.5 is already installed on the computer. Otherwise, download and install .NET Framework 4.5 from www.microsoft.com .
  20. 检查. net Framework 4.5是否已经安装在计算机上。否则,从www.microsoft.com下载并安装。net Framework 4.5。
  21. Open a command prompt with administrator privileges.
  22. 使用管理员权限打开一个命令提示符。
  23. Go to the directory where .NET Framework 4.5 SDK Tools installer files were copied.
  24. 进入。net Framework 4.5 SDK工具安装程序文件被复制的目录。
  25. Install .NET Framework 4.5 SDK tools by using the command line: Msiexec /i sdk_tools4.msi VSEXTUI=1
  26. 使用命令行安装. net Framework 4.5 SDK工具:Msiexec /i sdk_tools4。msi VSEXTUI = 1

#2


83  

To run on on your CI server without Visual Studio, you only need to copy a few folders from a development machine to the same location on the CI server. There is no need to install the SDK.

要在没有Visual Studio的CI服务器上运行,您只需将几个文件夹从开发机器复制到CI服务器上的相同位置。不需要安装SDK。

VS 2015:

VS 2015:

  • C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\Web
  • C:\Program Files (x86)\MSBuild\Microsoft\ VisualStudio \ v14.0 \ Web
  • C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\WebApplications
  • C:\Program Files (x86)\MSBuild\Microsoft\ VisualStudio \ v14.0 \ WebApplications

VS 2013:

VS 2013:

  • C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v12.0\Web
  • C:\Program Files (x86)\MSBuild\Microsoft\ VisualStudio \ v12.0 \ Web
  • C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v12.0\WebApplications
  • C:\Program Files (x86)\MSBuild\Microsoft\ VisualStudio \ v12.0 \ WebApplications

VS 2012:

VS 2012:

  • C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\Web
  • C:\Program Files (x86)\MSBuild\Microsoft\ VisualStudio \ v11.0 \ Web
  • C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\WebApplications
  • C:\Program Files (x86)\MSBuild\Microsoft\ VisualStudio \ v11.0 \ WebApplications

VS 2010:

VS 2010:

  • C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v10.0\Web
  • C:\Program Files (x86)\MSBuild\Microsoft\ VisualStudio \ v10.0 \ Web
  • C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v10.0\WebApplications
  • C:\Program Files (x86)\MSBuild\Microsoft\ VisualStudio \ v10.0 \ WebApplications

.NET 4.6:

net 4.6:

  • C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.6
  • C:\Program Files (x86)\Reference总成\微软\ \ .NETFramework \ v4.6框架

.NET 4.5.2:

net 4.5.2:

  • C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5.2
  • C:\Program Files (x86)\Reference总成\微软\ \ .NETFramework \ v4.5.2框架

.NET 4.5.1:

net 4.5.1:

  • C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5.1
  • C:\Program Files (x86)\Reference总成\微软\ \ .NETFramework \ v4.5.1框架

.NET 4.5:

net 4.5:

  • C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5
  • C:\Program Files (x86)\Reference微软组件\ \ \ .NETFramework \ v4.5开发框架

.NET 4.0.1:

net 4.0.1:

  • C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0.1
  • C:\Program Files (x86)\Reference总成\微软\ \ .NETFramework \ v4.0.1框架

.NET 4.0:

net 4.0:

  • C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0
  • C:\Program Files (x86)\Reference组件\ Microsoft \ Framework \ .NETFramework \ v4.0

Or, as Matt suggested, you could copy them into a subdirectory of your project and alter the <MSBuildExtensionsPath32> location in your MSBuild (typically .csproj or .vbproj) file.

或者,如Matt所建议的,您可以将它们复制到项目的子目录中,并在MSBuild(通常是.csproj或.vbproj)文件中修改 位置。

Once you have done this, your project will compile.

一旦你完成了这个,你的项目就会被编译。

You should also set the VisualStudioVersion environment variable explicitly to the Visual Studio version (10.0 for VS2010, 11.0 for VS2012, 12.0 for VS2013, 14.0 for VS2015) you are using just to be sure it is set right in your configuration.

您还应该将VisualStudioVersion环境变量显式地设置为VisualStudio版本(VS2010的10.0,VS2012的11.0,VS2013的12.0,VS2015的14.0),您只需要确定它在配置中是正确的。

#3


25  

From msdn:

从msdn:

The Windows SDK no longer ships with a complete command-line build environment. You must install a compiler and build environment separately. If you require a complete development environment that includes compilers and a build environment, you can download Visual Studio 2012 Express, which includes the appropriate components of the Windows SDK.

Windows SDK不再附带完整的命令行构建环境。您必须分别安装编译器和构建环境。如果您需要一个包含编译器和构建环境的完整开发环境,您可以下载Visual Studio 2012 Express,它包含Windows SDK的适当组件。

In order to fix this, I had to copy the folder C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5 from my development machine (which has Visual Studio 2012 by the way) onto the build agents. After this operation, Team City did not report any more errors and mscorlib.dll was not output to the bin folder.

为了解决这个问题,我必须复制文件夹C:\Program Files (x86)\Reference总成\ Microsoft \ Framework \ .NETFramework \ v4.5开发从开发机器(Visual Studio 2012)上构建代理。在此操作之后,Team City没有报告任何更多的错误和mscorlib。dll未输出到bin文件夹。

#4


12  

Microsoft Build Tools 2013 will help in this case, as its download page describes:

微软Build Tools 2013将在这种情况下提供帮助,其下载页面描述如下:

If you don't have Visual Studio installed on your computer, you can use Build Tools 2013 to build managed applications. The Visual Basic and C# compilers are also included in this download. (In earlier versions, these tools were included in the stand-alone .NET Framework.)

如果您的计算机上没有安装Visual Studio,您可以使用Build Tools 2013来构建托管应用程序。Visual Basic和c#编译器也包含在这个下载中。(在早期版本中,这些工具包含在独立的。net框架中。)

#5


7  

My dept. likes taking a minimalistic approach to what's installed on our Win 7 build machines. However, we don't like just copying and pasting files/folders because of potential registry key issues. Instead of installing VS 2013, I installed the following much smaller and free components. Now the dev team can build VS 2013 web apps successfully.

我的部门喜欢采用一种极简主义的方法来处理我们的win7构建机器上安装的东西。但是,我们不喜欢仅仅因为潜在的注册中心问题而复制和粘贴文件/文件夹。我没有安装VS 2013,而是安装了以下更小更免费的组件。现在开发团队可以成功构建VS 2013年的web应用。

#6


4  

I solve this problem with Visual Studio Agents.

我与Visual Studio代理解决这个问题。

You can try install Visual Studio Agents 2012.

您可以尝试安装Visual Studio Agents 2012。

http://www.microsoft.com/en-us/download/details.aspx?id=38186

http://www.microsoft.com/en-us/download/details.aspx?id=38186

#1


34  

My problem was related to installing the Windows Software Development Kit (SDK) for Windows 8 on a Windows 2008 Box. If you read further on the page, you will get to a heading labeled ".NET Framework 4.5 SDK Tools on Windows Vista and Windows Server 2008." This tells you to:

我的问题是在Windows 2008机顶盒上安装Windows 8软件开发工具包(SDK)。如果你在这一页上再读下去,你会看到一个标题,上面写着“”。NET Framework 4.5 SDK工具,适用于Windows Vista和Windows Server 2008。这告诉你:

  1. Run the Windows SDK for Windows 8 installer on a supported operating system (for example, Windows 7, or Windows 8).
  2. 在受支持的操作系统上运行Windows 8安装程序的Windows SDK(例如,Windows 7或Windows 8)。
  3. Choose the following option on the Specify Location screen: Download the Windows SDK for installation on a separate computer.
  4. 在指定位置屏幕上选择以下选项:下载Windows SDK,安装在单独的计算机上。
  5. Press the Next button.
  6. 按下一个按钮。
  7. Answer the questions on the Join the Customer Experience Improvement Program (CEIP) screen.
  8. 在“加入客户体验改进计划”(CEIP)屏幕上回答问题。
  9. On the next screen, choose the .NET Framework 4.5 Software Development Kit feature. Unselect all other features that can be unselected.
  10. 在下一个屏幕上,选择。net Framework 4.5 Software Development Kit特性。取消选择所有可能未被选中的其他功能。
  11. Choose the Download button.
  12. 选择下载按钮。
  13. Go to the download location (specified in step 2) and find the following .NET Framework 4.5 SDK tool installer files: sdk_tools4.msi, sdk_tools4.cab
  14. 转到下载位置(在步骤2中指定),找到以下。net Framework 4.5 SDK工具安装程序文件:sdk_tools4。msi,sdk_tools4.cab
  15. You can copy these files to a Windows Vista or Windows 2008 Server computer within your organization. These files need to be copied to same directory on the Windows Vista or Windows 2008 Server computer. Note: Do not redistribute these files outside your organization or as part of any other installer.
  16. 您可以将这些文件复制到您的组织内的Windows Vista或Windows 2008服务器计算机上。这些文件需要复制到Windows Vista或Windows 2008服务器上的同一目录。注意:不要在组织之外或作为任何其他安装程序的一部分重新分发这些文件。
  17. On the Windows Vista or Windows 2008 Server computer, review the license terms here .
  18. 在Windows Vista或Windows 2008服务器上,请查看这里的许可条款。
  19. Check whether .NET Framework 4.5 is already installed on the computer. Otherwise, download and install .NET Framework 4.5 from www.microsoft.com .
  20. 检查. net Framework 4.5是否已经安装在计算机上。否则,从www.microsoft.com下载并安装。net Framework 4.5。
  21. Open a command prompt with administrator privileges.
  22. 使用管理员权限打开一个命令提示符。
  23. Go to the directory where .NET Framework 4.5 SDK Tools installer files were copied.
  24. 进入。net Framework 4.5 SDK工具安装程序文件被复制的目录。
  25. Install .NET Framework 4.5 SDK tools by using the command line: Msiexec /i sdk_tools4.msi VSEXTUI=1
  26. 使用命令行安装. net Framework 4.5 SDK工具:Msiexec /i sdk_tools4。msi VSEXTUI = 1

#2


83  

To run on on your CI server without Visual Studio, you only need to copy a few folders from a development machine to the same location on the CI server. There is no need to install the SDK.

要在没有Visual Studio的CI服务器上运行,您只需将几个文件夹从开发机器复制到CI服务器上的相同位置。不需要安装SDK。

VS 2015:

VS 2015:

  • C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\Web
  • C:\Program Files (x86)\MSBuild\Microsoft\ VisualStudio \ v14.0 \ Web
  • C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\WebApplications
  • C:\Program Files (x86)\MSBuild\Microsoft\ VisualStudio \ v14.0 \ WebApplications

VS 2013:

VS 2013:

  • C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v12.0\Web
  • C:\Program Files (x86)\MSBuild\Microsoft\ VisualStudio \ v12.0 \ Web
  • C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v12.0\WebApplications
  • C:\Program Files (x86)\MSBuild\Microsoft\ VisualStudio \ v12.0 \ WebApplications

VS 2012:

VS 2012:

  • C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\Web
  • C:\Program Files (x86)\MSBuild\Microsoft\ VisualStudio \ v11.0 \ Web
  • C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\WebApplications
  • C:\Program Files (x86)\MSBuild\Microsoft\ VisualStudio \ v11.0 \ WebApplications

VS 2010:

VS 2010:

  • C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v10.0\Web
  • C:\Program Files (x86)\MSBuild\Microsoft\ VisualStudio \ v10.0 \ Web
  • C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v10.0\WebApplications
  • C:\Program Files (x86)\MSBuild\Microsoft\ VisualStudio \ v10.0 \ WebApplications

.NET 4.6:

net 4.6:

  • C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.6
  • C:\Program Files (x86)\Reference总成\微软\ \ .NETFramework \ v4.6框架

.NET 4.5.2:

net 4.5.2:

  • C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5.2
  • C:\Program Files (x86)\Reference总成\微软\ \ .NETFramework \ v4.5.2框架

.NET 4.5.1:

net 4.5.1:

  • C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5.1
  • C:\Program Files (x86)\Reference总成\微软\ \ .NETFramework \ v4.5.1框架

.NET 4.5:

net 4.5:

  • C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5
  • C:\Program Files (x86)\Reference微软组件\ \ \ .NETFramework \ v4.5开发框架

.NET 4.0.1:

net 4.0.1:

  • C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0.1
  • C:\Program Files (x86)\Reference总成\微软\ \ .NETFramework \ v4.0.1框架

.NET 4.0:

net 4.0:

  • C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0
  • C:\Program Files (x86)\Reference组件\ Microsoft \ Framework \ .NETFramework \ v4.0

Or, as Matt suggested, you could copy them into a subdirectory of your project and alter the <MSBuildExtensionsPath32> location in your MSBuild (typically .csproj or .vbproj) file.

或者,如Matt所建议的,您可以将它们复制到项目的子目录中,并在MSBuild(通常是.csproj或.vbproj)文件中修改 位置。

Once you have done this, your project will compile.

一旦你完成了这个,你的项目就会被编译。

You should also set the VisualStudioVersion environment variable explicitly to the Visual Studio version (10.0 for VS2010, 11.0 for VS2012, 12.0 for VS2013, 14.0 for VS2015) you are using just to be sure it is set right in your configuration.

您还应该将VisualStudioVersion环境变量显式地设置为VisualStudio版本(VS2010的10.0,VS2012的11.0,VS2013的12.0,VS2015的14.0),您只需要确定它在配置中是正确的。

#3


25  

From msdn:

从msdn:

The Windows SDK no longer ships with a complete command-line build environment. You must install a compiler and build environment separately. If you require a complete development environment that includes compilers and a build environment, you can download Visual Studio 2012 Express, which includes the appropriate components of the Windows SDK.

Windows SDK不再附带完整的命令行构建环境。您必须分别安装编译器和构建环境。如果您需要一个包含编译器和构建环境的完整开发环境,您可以下载Visual Studio 2012 Express,它包含Windows SDK的适当组件。

In order to fix this, I had to copy the folder C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5 from my development machine (which has Visual Studio 2012 by the way) onto the build agents. After this operation, Team City did not report any more errors and mscorlib.dll was not output to the bin folder.

为了解决这个问题,我必须复制文件夹C:\Program Files (x86)\Reference总成\ Microsoft \ Framework \ .NETFramework \ v4.5开发从开发机器(Visual Studio 2012)上构建代理。在此操作之后,Team City没有报告任何更多的错误和mscorlib。dll未输出到bin文件夹。

#4


12  

Microsoft Build Tools 2013 will help in this case, as its download page describes:

微软Build Tools 2013将在这种情况下提供帮助,其下载页面描述如下:

If you don't have Visual Studio installed on your computer, you can use Build Tools 2013 to build managed applications. The Visual Basic and C# compilers are also included in this download. (In earlier versions, these tools were included in the stand-alone .NET Framework.)

如果您的计算机上没有安装Visual Studio,您可以使用Build Tools 2013来构建托管应用程序。Visual Basic和c#编译器也包含在这个下载中。(在早期版本中,这些工具包含在独立的。net框架中。)

#5


7  

My dept. likes taking a minimalistic approach to what's installed on our Win 7 build machines. However, we don't like just copying and pasting files/folders because of potential registry key issues. Instead of installing VS 2013, I installed the following much smaller and free components. Now the dev team can build VS 2013 web apps successfully.

我的部门喜欢采用一种极简主义的方法来处理我们的win7构建机器上安装的东西。但是,我们不喜欢仅仅因为潜在的注册中心问题而复制和粘贴文件/文件夹。我没有安装VS 2013,而是安装了以下更小更免费的组件。现在开发团队可以成功构建VS 2013年的web应用。

#6


4  

I solve this problem with Visual Studio Agents.

我与Visual Studio代理解决这个问题。

You can try install Visual Studio Agents 2012.

您可以尝试安装Visual Studio Agents 2012。

http://www.microsoft.com/en-us/download/details.aspx?id=38186

http://www.microsoft.com/en-us/download/details.aspx?id=38186