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!

Reply to this discussion

Internal reply

Formatting help / Preview (switch to plain text) No formatting (switch to Markdown)

Attaching KB article:

»

Attached Files

You can attach files up to 10MB

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

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