理想情况下,我想安装Visual Studio 2015 Tools for Unity,其中包括.NET 3.5 Subset。但是.NET 3.5会这样做。
当我尝试在VSTS中构建项目时,我收到以下构建错误:
[error]C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\15.0\Bin\Microsoft.Common.CurrentVersion.targets(1122,5): Error MSB3644: The reference assemblies for framework ".NETFramework,Version=v3.5,Profile=v3.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.
我发现了以下问题:VSTS Hosted Build .Net Framework 4.6.2
但似乎解决方案是在代理运行的机器上安装目标框架。但是我在VSTS中使用托管代理。
我假设我可以在这里找到目标包:https://www.microsoft.com/net/download/visual-studio-sdks但是无法在托管代理计算机上安装它们。
我可以在不创建自己的代理的情况下完成这项工作吗?
答案 0 :(得分:4)
尝试在.csproj
文件中添加对.NET 3.5参考部件位置的引用。
<PropertyGroup>
<FrameworkPathOverride Condition="'$(TargetFramework)' == 'net35'">$(MSBuildProgramFiles32)\Reference Assemblies\Microsoft\Framework\.NETFramework\v3.5\Profile\Client</FrameworkPathOverride>
</PropertyGroup>
参考:Cannot find reference assemblies for .NET 3.5 or lower using core msbuild