在哪里可以为我的构建服务器下载 .NET 4.5 Multitargeting Pack?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/17220615/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-03 12:19:47  来源:igfitidea点击:

Where can I download the .NET 4.5 Multitargeting Pack for my build server?

.netcontinuous-integration.net-4.5

提问by Michael Haren

I want to build a .net 4.5/VS2012 solution in TeamCity. My builds work on the agent that has VS2012 installed, but on the agent that doesn't have VS2012, I get warnings like this:

我想在 TeamCity 中构建一个 .net 4.5/VS2012 解决方案。我的构建在安装了 VS2012 的代理上工作,但在没有 VS2012 的代理上,我收到如下警告:

C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(983,5): warning MSB3644: The reference assemblies for framework ".NETFramework,Version=v4.5" were not found.

To resolve this, install the SDK or Targeting Pack for this framework version or retarget your application to a version of the framework for which you have the SDK or Targeting Pack installed. Note that assemblies will be resolved from the Global Assembly Cache (GAC) and will be used in place of reference assemblies. Therefore your assembly may not be correctly targeted for the framework you intend.

C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(983,5):警告 MSB3644:未找到框架“.NETFramework,Version=v4.5”的参考程序集。

要解决此问题,请为此框架版本安装 SDK 或 Targeting Pack,或者将您的应用程序重新定位到安装了 SDK 或 Targeting Pack 的框架版本。请注意,程序集将从全局程序集缓存 (GAC) 中解析,并将用于代替引用程序集。因此,您的程序集可能没有正确针对您想要的框架。

Can I install the targets without installing all of Visual Studio 2012, like I could with .NET 4.0?

我可以在不安装所有 Visual Studio 2012 的情况下安装目标吗,就像在 .NET 4.0 中一样?

Where's the download?

哪里有下载?

(I feel ridiculous asking this...but I have searched and searched for it! Honest! This sitesuggests it's only available with VS2012, which seems like madness.)

(我觉得这个问题很荒谬......但我已经搜索并搜索了它!老实说!该站点表明它仅适用于 VS2012,这似乎很疯狂。)

回答by cederlof

You don't need to install any SDK. Just copy the following folder from your development machine into the same folder of your TFS build machine:

您无需安装任何 SDK。只需将以下文件夹从您的开发机器复制到您的 TFS 构建机器的同一文件夹中:

C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5

C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5



If this doesn't work for you, refer to: http://getdotnet.azurewebsites.net/target-dotnet-platforms.htmlwhere you'll find the SDKs you need. However note the comment from @Lu55: Link to "Windows Software Development Kit (SDK) for Windows 8" from .NET Framework 4.5 section unexpectedly redirects to "Windows Software Development Kit (SDK) for Windows 8.1" which is for .NET Framework 4.5.1.

如果这对您不起作用,请参阅:http: //getdotnet.azurewebsites.net/target-dotnet-platforms.html,您可以在其中找到所需的 SDK。但是请注意来自@Lu55 的评论:.NET Framework 4.5 部分的“Windows 软件开发工具包(SDK)”部分意外重定向到“Windows 8.1 的 Windows 软件开发工具包(SDK)”,该工具包适用于 .NET Framework 4.5 .1.



@dotarj mentions: The link for Windows Software Development Kit (SDK) for Windows 8, which is actually for .NET Framework 4.5, is: https://developer.microsoft.com/en-us/windows/downloads/windows-8-sdk

@dotarj 提到:适用于 Windows 8 的 Windows 软件开发工具包 (SDK) 的链接,实际上适用于 .NET Framework 4.5,是:https: //developer.microsoft.com/en-us/windows/downloads/windows-8 -sdk

回答by Simon_Weaver

If you're looking for proof it's in the Windows SDKhere's the installer :

如果您正在寻找证据,它在Windows SDK 中,这是安装程序:

enter image description here

在此处输入图片说明

Note: This still doesn't give you Microsoft.WebApplication.targetsfor which you still need to either copy it manually, or install VS on your server.

注意:这仍然没有给你Microsoft.WebApplication.targets,你仍然需要手动复制它,或者在你的服务器上安装 VS。

I just went ahead with the free Visual Studio Express 2013which fixed this.

我只是继续使用免费的Visual Studio Express 2013解决了这个问题。

回答by Duftstenen

try to install the Windows SDK for Windows 8, http://msdn.microsoft.com/en-us/library/windows/desktop/hh852363.aspx, it worked for me.

尝试安装适用于 Windows 8 的 Windows SDK,http://msdn.microsoft.com/en-us/library/windows/desktop/hh852363.aspx,它对我有用。

回答by Raffaeu

This is the official solution which worked for me (TFS 2012) http://dotnetnsqlcorner.blogspot.nl/2012/11/microsoftcommomtargets-warning-983.html

这是对我有用的官方解决方案(TFS 2012) http://dotnetnsqlcorner.blogspot.nl/2012/11/microsoftcommomtargets-warning-983.html

In short:

简而言之:

  1. Install SDK or Targetting-Pack for .NET Framework 4.5. But they are considerably large in size.
  2. The other option is to copy following folder from your development machine to your TFS build machine. C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework.NETFramework\v4.5
  1. 安装 SDK 或 Targetting-Pack for .NET Framework 4.5。但它们的尺寸相当大。
  2. 另一种选择是将以下文件夹从您的开发机器复制到您的 TFS 构建机器。 C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework.NETFramework\v4.5

回答by Colonel Panic

This page lists .NET SDKs for each Visual Studio version. http://getdotnet.azurewebsites.net/target-dotnet-platforms.html

此页面列出了每个 Visual Studio 版本的 .NET SDK。http://getdotnet.azurewebsites.net/target-dotnet-platforms.html

For a smaller download choose the 'developer pack' or 'targeting pack' rather than the full Windows SDK.

对于较小的下载,请选择“开发人员包”或“目标包”而不是完整的 Windows SDK。

回答by Khado Mikhal

My OS is Win7 x64

我的操作系统是 Win7 x64

I have the same problem and based on another answer I found a solution:

我有同样的问题,根据另一个答案,我找到了解决方案:

I have only "C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework.NETFramework\v4.5.2" in my system and to resolve it I renamed v4.52 to v4.5 and it worked.

我的系统中只有“ C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework.NETFramework\v4.5.2”,为了解决它,我将 v4.52 重命名为 v4.5 并且它起作用了。

So for the long run I've made a junction to the 4.5.2 folder and renamed the junction point v.4.5 and it work.

因此,从长远来看,我已经与 4.5.2 文件夹建立了连接,并将连接点重命名为 v.4.5 并且它可以工作。

回答by Anthony Liriano

I was getting the error below on Windows Server 2016

我在Windows Server 2016上收到以下错误

The reference assemblies for framework ".NETFramework, Version=4.6.1" were not found

未找到框架“.NETFramework, Version=4.6.1”的参考程序集

I went on my build server "C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework" and noticed that I didn't have the required versions.

我继续我的构建服务器“ C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework”并注意到我没有所需的版本。

I then Installed the latest .NET Framework version from https://visualstudio.microsoft.com/downloads/

然后我从https://visualstudio.microsoft.com/downloads/安装了最新的 .NET Framework 版本

回答by Chef Pharaoh

I'm running into this problem in my project using Visual Studio 2013 and .NET 4.5. Seems like a problem because I moved the project to another directory.

我在使用 Visual Studio 2013 和 .NET 4.5 的项目中遇到了这个问题。似乎有问题,因为我将项目移到了另一个目录。

You can fix this issue by verifying that the HintPathin the project file is correct or not (.csproj file).

您可以通过验证HintPath项目文件中的 .csproj 文件是否正确来解决此问题。

<HintPath>..\..\..\..\..\..\..\..\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETCore\v4.5.1\System.Runtime.WindowsRuntime.dll</HintPath>

Since I created a new directory and moved my project into that directory, I found that the relative path to the System.Runtime.WindowsRuntime.dllin the HintPathwas no longer correct, and thus, could not find the library.

自从我创建了一个新的目录,并动了我的项目到该目录中,我发现,在相对路径System.Runtime.WindowsRuntime.dllHintPath已不再正确,因而找不到库。

Fixing this path resolved the issue for me.

修复这条路径为我解决了这个问题。