繁体   English   中英

如何使用托管代理在VSTS中构建针对.NET 3.5的.csproj?

[英]How can I build a .csproj that targets .NET 3.5 in VSTS using a Hosted agent?

理想情况下,我想安装包含.NET 3.5子集的Visual Studio 2015 Tools for Unity。 但是.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托管版本.Net Framework 4.6.2

但似乎解决方案是在代理运行所在的计算机上安装目标框架。 但是,我在VSTS中使用托管代理。

我假设可以在以下位置找到目标软件包: https : //www.microsoft.com/net/download/visual-studio-sdks,但是无法在托管代理计算机上安装它们。

我可以在不创建自己的代理的情况下进行此工作吗?

尝试在.csproj文件中添加对.NET 3.5参考程序集位置的引用。

<PropertyGroup>
  <FrameworkPathOverride Condition="'$(TargetFramework)' == 'net35'">$(MSBuildProgramFiles32)\Reference Assemblies\Microsoft\Framework\.NETFramework\v3.5\Profile\Client</FrameworkPathOverride>
</PropertyGroup>

参考: 使用核心msbuild无法找到.NET 3.5或更低版本的参考程序集

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM