VSTS Hosted Build .Net Framework 4.6.2

2019-04-03 23:59发布

I'm getting errors during VSTS build process stating .net 4.6.2 is not found. Any idea when it will be made available on the build agents?

2016-08-30T17:09:31.0009946Z ##[error]C:\Program Files (x86)\MSBuild\14.0\bin\Microsoft.Common.CurrentVersion.targets(1098,5): Error MSB3644: The reference assemblies for framework ".NETFramework,Version=v4.6.2" 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.

6条回答
爷、活的狠高调
2楼-- · 2019-04-04 00:38

Add below to web.config or mentioned by hirigoshy use targetframework property as part of build process.

<compilation debug="true" targetFramework="4.6.2"/>
查看更多
男人必须洒脱
3楼-- · 2019-04-04 00:43

just add this line to Build solution -> MSBuild Arguments

/p:TargetFrameworkVersion=v4.6.2

查看更多
乱世女痞
4楼-- · 2019-04-04 00:47

Download the correct DEVELOPER targetting pack from here:

https://www.microsoft.com/net/targeting

查看更多
甜甜的少女心
5楼-- · 2019-04-04 00:47

First of all, be sure that the .NET framework are you using is listed here: Targeting .NET Platforms (I don't understand why 4.6.1 is not listed and 4.6.2 is listed.).

To resolve the issue about that the .Net Framework is not found, use Nuget 3.5.0 RC2. It solved the issue for me.

Nuget version that solve the issue

查看更多
做自己的国王
6楼-- · 2019-04-04 00:51

I experienced this issue when i was using a default Host as Agent- instead use a agent with dotNet Framework support. (e.g Hosted VS2017)

查看更多
戒情不戒烟
7楼-- · 2019-04-04 00:56

Based on my test, I can reproduce that issue with Hosted Build. Net Framework 4.6.2 isn’t available on Hosted Build now.

You can refer to this thread https://social.msdn.microsoft.com/Forums/en-US/f62a8156-d6a0-4a16-848e-ac426b3656a9/hosted-agent-support-for-net-framework-462?forum=TFService and vote this user voice https://visualstudio.uservoice.com/forums/330519-team-services/suggestions/15691884-add-net-4-6-2-on-vsts-hosted-agent

The workaround is that you could setup a new build server on your machine with .Net Framework 4.6.2 be installed.

查看更多
登录 后发表回答