MSBuild version for VS 2017

Gennady Verdel's Avatar

Gennady Verdel

18 Jun, 2017 02:05 AM

I have a solution which was created in VS 2015 and then migrated to VS 2017 by Visual Studio itself.
I want this solution to use MSBuild 15 to be able to compile C# 7.0 successfully .
Setting the install: value in .yml results in parsing error.
What is the correct way of doing this?

  1. Support Staff 1 Posted by Feodor Fitsner on 18 Jun, 2017 06:34 PM

    Feodor Fitsner's Avatar

    Correct way is adding this to your appveyor.yml:

    image: Visual Studio 2017
    

    feel free to send us your appveyor.yml if you are still having issues with it.

  2. 2 Posted by alex on 04 Sep, 2017 08:47 PM

    alex's Avatar

    For some reason, it does not help with this build:
    https://ci.appveyor.com/project/hallem/restsharp-822/build/105.0.1.188

    You can see it is building this: https://github.com/restsharp/RestSharp/commit/ac5e6d0087958b9e88534...
    which includes this line:
    image: Visual Studio 2017

    However, it still uses:

    MSBuild auto-detection: using msbuild version '14.0' from 'C:\Program Files (x86)\MSBuild\14.0\bin\amd64'.

    Same code built on my own configuration builds with msbuild 15:
    https://ci.appveyor.com/project/alexeyzimarev/restsharp

  3. 3 Posted by corneliu on 05 Sep, 2017 12:42 AM

    corneliu's Avatar

    I have the same issue. I need my project to use the MSBuild from
    C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\Bin\MsBuild.exe

  4. Support Staff 4 Posted by Feodor Fitsner on 05 Sep, 2017 04:28 PM

    Feodor Fitsner's Avatar

    @alex - could you please try adding where msbuild before nuget restore command to confirm it's VS 2017 image?

  5. 5 Posted by alex on 05 Sep, 2017 05:56 PM

    alex's Avatar

    Right, thank you Feodor. It seems that my build plan uses appveyor.yml file, whilst the upstream build plan ignores it. My command `which msbuild.exe` does not appear there at all.

  6. Support Staff 6 Posted by Feodor Fitsner on 05 Sep, 2017 06:33 PM

    Feodor Fitsner's Avatar

    No problem!

  7. 7 Posted by Phil Haack on 11 Dec, 2017 07:23 PM

    Phil Haack's Avatar

    I'm running into a similar problem. You can see the failed build here: https://ci.appveyor.com/project/Haacked/rothko/build/1.0.104

    My appveyor.yml is here: https://github.com/Haacked/Rothko/blob/master/appveyor.yml

    Also, I have enable nuget package restore to true and that seems to be ignored as well.

  8. 8 Posted by alex on 11 Dec, 2017 07:28 PM

    alex's Avatar

    Phil, are you sure the yml file is being used? In my case, for the failing build I had this checkbox "ignore appveyor.yml file" enabled.

  9. 9 Posted by Phil Haack on 11 Dec, 2017 07:33 PM

    Phil Haack's Avatar

    Yes, the "ignore appveyor.yml file" checkbox is NOT checked.

  10. Support Staff 10 Posted by Ilya Finkelshte... on 11 Dec, 2017 07:36 PM

    Ilya Finkelshteyn's Avatar

    I think that you already made a right fix :) Please also add nuget restore as before_build command.

  11. 11 Posted by Phil Haack on 12 Dec, 2017 03:09 AM

    Phil Haack's Avatar

    Thanks! I'm all set.

  12. 12 Posted by Matheus Moreira on 10 Apr, 2018 07:23 PM

    Matheus Moreira's Avatar

    I have the same problem at https://ci.appveyor.com/project/MundiPagg/portal-merchantmanagement is not building with 15 version.

    Could you please help?

  13. Support Staff 13 Posted by Feodor Fitsner on 10 Apr, 2018 07:26 PM

    Feodor Fitsner's Avatar

    Make sure you are building on Visual Studio 2017 image.

  14. 14 Posted by Matheus Moreira... on 10 Apr, 2018 07:27 PM

    Matheus Moreira | Mundipagg's Avatar
  15. Support Staff 15 Posted by Feodor Fitsner on 10 Apr, 2018 07:40 PM

    Feodor Fitsner's Avatar

    OK, could you please email a build log to further work on your case? I'm going to close this public discussion.

  16. Feodor Fitsner closed this discussion on 10 Apr, 2018 07:40 PM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac