4

My project need to be run with MSbuild 14.0(visual studio 2015) but this is taking only Visual Studio\2017\Community\MSBuild\15.0\Bin\msbuild.exe .

I have installed visual studio community 2017,VS 2015 web and Desktop express on my Build Agent. Capabilities of build agent- enter image description here

Task Configuration - enter image description here

This configuration giving me the warning -

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

How can I use MSBuild 14.0 with Visual Studio build task .?? This is running with MSbuild task..

Thanks in Advance ..!!

Community
  • 1
  • 1
Darshana Patel
  • 507
  • 1
  • 11
  • 25
  • I found link - https://stackoverflow.com/questions/42689384/how-to-use-visual-studio-2017-with-tfs-visual-studio-build-step...but isnt it possible with VSbuild task.??that is my question now. – Darshana Patel Oct 22 '18 at 10:42
  • And why I am so curious because Visual Studio Build task itself has option to select visual studio version. – Darshana Patel Oct 22 '18 at 12:40
  • 1
    Are you sure you have installed Visual Studio 2015 instance on your Build Agent? And you can try to add a MSBuild Arguments `/p:VisualStudioVersion=14.0`. If still have this issue, please create a new blank project and submit it to the build agent and build it, check the result. – Leo Liu Oct 23 '18 at 07:17
  • Hey @LeoLiu-MSFT ,Thanks for replying..Yes, VS 2015 Express for Desktop and Web Installed on Build Agent. I have also tried passing this configuration you said..but No success..FYI --> MSBuild 14.0 is working with MSBuild task..but not with Visual studio build Task .. – Darshana Patel Oct 23 '18 at 07:26
  • 1
    Could you please try to install the Visual Studio community 2015 instead of VS 2015 Express for Desktop and Web, I am not sure whether VS 2015 Express for Desktop and Web is compatible with build agent, but I could use MSBuild 14.0 with Visual Studio build task without any issue. – Leo Liu Oct 23 '18 at 07:34
  • And yeah, I have a lot of questions Like, How one system will decide which MSBuild version needs to run out of multiple versions? whether from VS or from .net framework...? Because checked Environment Variable also which does not have any settings for msbuild. – Darshana Patel Oct 23 '18 at 07:36
  • If you are using Visual Studio build task, you will select the Visual Studio version, like Visual Studio 2015, then build agent will find the capabilities of corresponding MSBuild, MSBuild 14.0, if you are using MSBuild task, you can specify MSBuild.exe directly. – Leo Liu Oct 23 '18 at 07:41
  • So yaa..I guess we are on the right track ...as I have checked with another machine(installed VS2015 express ,.net framework 4.0.3xx) which is giving me warning of "##[warning]Visual Studio version '14.0' not found. Falling back to version '10.0'."... – Darshana Patel Oct 23 '18 at 07:48
  • .I have select this Property Visual Studio version in VSbuild task...but same error..so based on that can we conclude that Express edision will not allow to use their msbuild as an agent's builder ..? – Darshana Patel Oct 23 '18 at 07:54
  • Yes, you can check this thread:https://stackoverflow.com/questions/45567632/visual-studio-2015-express-not-recognised-by-private-build-agent and my answer below. – Leo Liu Oct 23 '18 at 08:12

1 Answers1

1

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

Since I do not install Visual Studio 2015 Express for Desktop and Web on my build agent, I am not sure whether Visual Studio 2015 Express for Desktop and Web is compatible with build agent.

But I found a thread about it, you can check the comment on the accepted answer:

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.

So, it seems that Visual Studio 2015 Express is not compatible with build agent. you can try to install the Visual Studio community 2015 instead of it, which I can build it without any issue.

Again, you can check if there is a parameter about Visual Studio on your Capabilities of build agent when you use Visual Studio 2015 Express:

enter image description here

if not, build agent will throw that error.

Hope this helps.

Community
  • 1
  • 1
Leo Liu
  • 71,098
  • 10
  • 114
  • 135
  • Yes...VisualStudio_15.0 has value C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\ .. Thank you so much for this clarification.. – Darshana Patel Oct 23 '18 at 08:40