.net core on VS 2015 image

michiel's Avatar

michiel

20 Mar, 2017 08:02 PM

About an hour ago our .net core builds stopped working on the VS 2015 image. The Previous VS 2015 image does work.

Error message:
error MSB4019: The imported project "C:\Program Files\dotnet\sdk\1.0.1\Microsoft\VisualStudio\v14.0\DotNet\Microsoft.DotNet.Props" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk.

  1. Support Staff 1 Posted by Feodor Fitsner on 20 Mar, 2017 08:08 PM

    Feodor Fitsner's Avatar

    We are gradually rolling out an update to Visual Studio 2015 image where .NET Core SDK 1.0.1 is installed.

    Adding global.json to the folder with solution should fix that error: https://github.com/appveyor/ci/issues/1377#issuecomment-287644271

    Let me know if that worked.

  2. 2 Posted by michiel on 20 Mar, 2017 08:25 PM

    michiel's Avatar

    I already have a global.json with SDK 1.0.0-preview2-1-003177 in my projects for a few months. Used to work fine. .Net core sdk 1.0.1 is not new, it was released in september 2016 I think.

  3. Support Staff 3 Posted by Feodor Fitsner on 20 Mar, 2017 08:30 PM

    Feodor Fitsner's Avatar

    Is global.json located in the same folder with .sln file?
    How do you build the app?

  4. 4 Posted by michiel on 20 Mar, 2017 08:53 PM

    michiel's Avatar

    Yes, located in the same folder.

    But before building I'm manually calling dotnet restore, and then it's giving the error.

  5. Support Staff 5 Posted by Feodor Fitsner on 20 Mar, 2017 08:59 PM

    Feodor Fitsner's Avatar

    If you are calling dotnet restore <path-to\solution.sln> for the solution file which is not in the root of the repo then add another global.json to the root of the repo:

    {
      "sdk": {
        "version": "1.0.0-preview2-1-003177"
      }
    }
    

    dotnet command line is first looking for global.json in the current folder.

  6. 6 Posted by michiel on 21 Mar, 2017 09:53 AM

    michiel's Avatar

    Ok thanks, it worked.

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