##[警告]Visual Studio 未找到版本“14.0”。回退到版本“15.0”

##[warning]Visual Studio version '14.0' not found. Falling back to version '15.0'

我的项目需要 运行 使用 MSbuild 14.0(visual studio 2015) 但这只需要 Visual Studio17\Community\MSBuild.0\Bin\msbuild.exe .

我已经在我的 Build Agent 上安装了 visual studio community 2017、VS 2015 web 和 Desktop express。 构建代理的能力-

任务配置 -

此配置给我警告 -

[警告]Visual Studio 未找到版本“14.0”。回退到版本“15.0”。

如何将 MSBuild 14.0 与 Visual Studio 构建任务结合使用。??这是 运行 MSbuild 任务..

提前致谢..!!

[warning]Visual Studio version '14.0' not found. Falling back to version '15.0'

由于我没有在我的构建代理上安装 Visual Studio 2015 Express for Desktop and Web,我不确定 Visual Studio 2015 Express for Desktop and Web 是否与构建代理兼容。

但是我发现了,你可以查看已接受答案的评论:

That's it! For some reason VS2015 Express does not install the ShellFolder or InstallDir keys! I was worried that the agent script recognised it but refused to register it because we are not allowed to use it for automated builds. I feel more comfortable with it now.

It turns out that is not the full story. When I add the "Visual Studio Build" task to the process, it now executes, but if I look more closely at the log, I can see the following message: "##[warning]Visual Studio was not found. Try installing a supported version of Visual Studio. See the task definition for a list of supported versions." And then it falls back to building with MSBuild. It works because I am building a .sln; let's just hope I don't have to build a .proj.

因此,Visual Studio 2015 Express 似乎与构建代理不兼容。您可以尝试安装 Visual Studio community 2015 而不是它,我可以毫无问题地构建它。

同样,您可以在使用Visual Studio 2015 Express时检查您的构建代理的功能是否有关于Visual Studio的参数:

如果没有,构建代理将抛出该错误。

希望对您有所帮助。