Build error after Linux image update

Niklas Mattsson's Avatar

Niklas Mattsson

18 Jun, 2019 06:55 AM

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=

Could be releted to this:

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

Niklas Mattsson

  1. Support Staff 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

    The result is the same as I described earlier.

    Link to build:

  3. Support Staff 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. Support Staff 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. Support Staff 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 -o
      - bash ./ --version 2.2.102
  8. 8 Posted by Niklas Mattsson on 28 Jun, 2019 09:11 AM

    Niklas Mattsson's Avatar
  9. Support Staff 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

    No problem.

    But on the builds I am back on the first error again...


  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 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

    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


? 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

Recent Discussions

16 Jul, 2019 05:17 PM
16 Jul, 2019 10:17 AM
16 Jul, 2019 07:46 AM
16 Jul, 2019 04:51 AM
15 Jul, 2019 06:33 PM


15 Jul, 2019 06:09 PM
15 Jul, 2019 05:53 PM
15 Jul, 2019 05:46 PM
15 Jul, 2019 05:21 PM
15 Jul, 2019 04:29 PM
15 Jul, 2019 03:12 PM