gpt4 book ai didi

msbuild - Team City 上的 .Net 4.5.1

转载 作者:行者123 更新时间:2023-12-04 02:40:47 25 4
gpt4 key购买 nike

我正在尝试在 team city 服务器上构建 .Net 4.5.1 web 项目。我已经安装了 Windows 8.1 SDK,其中似乎包含程序集 Microsoft.Build.Tasks.v4.0.dll。但是,当我尝试构建项目时,我仍然遇到错误:

C:\TeamCity\buildAgent\work\bdb0a42dd3d7277\.nuget\NuGet.targets(71, 9): error MSB4175: The task factory "CodeTaskFactory" could not be loaded from the assembly "C:\Program Files (x86)\MSBuild\12.0\bin\Microsoft.Build.Tasks.v4.0.dll". Could not load file or assembly 'file:///C:\Program Files (x86)\MSBuild\12.0\bin\Microsoft.Build.Tasks.v4.0.dll' or one of its dependencies. The system cannot find the file specified.

我需要在构建服务器上安装什么或从我的构建环境中复制什么?

更新

问题仍然悬而未决,但现在我已经通过编辑项目文件以使用 MSBuild 4.0 而不是 12 解决了这个问题。

最佳答案

通过 rake 使用 msbuild 任务时,我遇到了类似的问题:http://www.beta.microsoft.com/VisualStudio/feedback/details/806393/error-trying-to-build-using-msbuild-from-code

Hello and thank you for the feedback. I believe you are running into this issue as a side-effect of MSBuild moving out of the .NET Framework (more info here: http://blogs.msdn.com/b/visualstudio/archive/2013/07/24/msbuild-is-now-part-of-visual-studio.aspx).

Your project is referencing the older version of MSBuild that is still in the .NET Framework. This version was used until Visual Studio 2013. Since you are debugging the project from Visual Studio 2013, the VisualStudioVersion environment variable is automatically set to “12.0”. This is causing the 2013 code analysis targets to be loaded with the project, but these targets are not compatible with the old version of MSBuild because VS 2013 uses MSBuild 12.0 exclusively.

关于msbuild - Team City 上的 .Net 4.5.1,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19986720/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com