Build error after Linux image update

Niklas Mattsson's Avatar

Niklas Mattsson

18 Jun, 2019 06:55 AM

Hi
After the latest Linux image update (June 14, 2019) all my .net core project fail to build.

error MSB4018: System.TypeLoadException: Could not load type of field 'Microsoft.NET.Build.Tasks.DependencyContextBuilder:_filteredPackage

Could not resolve type with token 01000027 from typeref (expected class 'NuGet.Packaging.Core.PackageIdentity' in assembly 'NuGet.Packaging, Version=5.1.0.5

Could be releted to this: https://github.com/NuGet/Home/issues/7956

When switching to "image: Previous Ubuntu" the project build again.

BR
Niklas Mattsson

  1. 1 Posted by Owen McDonnell on 19 Jun, 2019 04:13 AM

    Owen McDonnell's Avatar

    Can you go to the last working build in one of those projects and hit RE-BUILD COMMIT button and let us know the results.

    Also, send a link to that build.

  2. 2 Posted by Niklas Mattsson on 19 Jun, 2019 05:04 AM

    Niklas Mattsson's Avatar

    Hi
    The result is the same as I described earlier.

    Link to build:
    https://ci.appveyor.com/project/extendaretail/mcpe-loyalty/builds/25379028

  3. 3 Posted by Owen McDonnell on 19 Jun, 2019 04:53 PM

    Owen McDonnell's Avatar

    Can you add a global.json file to that project with contents:

    {
      "sdk": {
        "version": "2.2.102"
      }
    }
    

    and run a build on the current image and see if that succeeds.

  4. 4 Posted by Niklas Mattsson on 24 Jun, 2019 05:40 AM

    Niklas Mattsson's Avatar

    I added a global.json in the solution directory. But it still gives the
    same error.

  5. 5 Posted by Owen McDonnell on 25 Jun, 2019 05:18 AM

    Owen McDonnell's Avatar

    Can you share a link to the build for that commit in which you added the global.json.

  6. 6 Posted by Niklas Mattsson on 25 Jun, 2019 05:27 AM

    Niklas Mattsson's Avatar
  7. 7 Posted by Owen McDonnell on 26 Jun, 2019 06:01 AM

    Owen McDonnell's Avatar

    Sorry, I gave you a pointless task. That global.json didn't take effect since that version of the sdk is not present (having been updated).

    Can you add the following two lines to the init: stage of your build

      - curl https://dot.net/v1/dotnet-install.sh -o dotnet-install.sh
      - bash ./dotnet-install.sh --version 2.2.102
    
  8. 8 Posted by Niklas Mattsson on 28 Jun, 2019 09:11 AM

    Niklas Mattsson's Avatar
  9. 9 Posted by Owen McDonnell on 28 Jun, 2019 04:52 PM

    Owen McDonnell's Avatar

    Sorry for the back and forth, can you try those lines at the beginning of install: stage instead.

  10. 10 Posted by Niklas Mattsson on 03 Jul, 2019 03:29 PM

    Niklas Mattsson's Avatar

    Hi
    No problem.

    But on the builds I am back on the first error again...
    https://ci.appveyor.com/project/extendaretail/mcpe-loyalty/builds/25725157

    /Niklas

  11. Support Staff 11 Posted by Feodor Fitsner on 03 Jul, 2019 06:09 PM

    Feodor Fitsner's Avatar

    Hi Niklas,

    Looking at the last build log, line 658: Microsoft (R) Build Engine version 16.0.0.0 for Mono. The word Mono worries me there as you are building .NET Core project, right?
    MSBuild greeting for .NET looks like Microsoft (R) Build Engine version 16.2.0-preview-19278-01+d635043bd for .NET Core

    What is the command used to build the solution?

  12. 12 Posted by Niklas Mattsson on 04 Jul, 2019 07:47 AM

    Niklas Mattsson's Avatar

    Hi
    Ok, that was the problem. I use Cake and start the build using
    *MSBuild(solution)*. I now switched to *DotNetCoreBuild(solution);* and the
    problem disappeared.

    Thank you!

  13. Ilya Finkelshteyn closed this discussion on 08 Jul, 2019 07:18 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