Build failing - project.assets.json doesn't have a target for 'net48'

David Le Bansais's Avatar

David Le Bansais

14 Nov, 2020 08:07 PM

My projects have been building fine, but all of a sudden I'm getting this error when I click RE-BUILD COMMIT (or when I commit changes, but re-building something and failing when it used to work is more indicative of a problem in AppVeyor):

  C:\Program Files\dotnet\sdk\5.0.100\Sdks\Microsoft.NET.Sdk\targets\Microsoft.PackageDependencyResolution.targets(241,5): error NETSDK1005: Assets file 'C:\projects\updatecheck\PreBuild\obj\project.assets.json' doesn't have a target for 'net48'. Ensure that restore has run and that you have included 'net48' in the TargetFrameworks for your project.

The public repo is: https://github.com/dlebansais/UpdateCheck

It's happening to all my projects, they were all building properly until a few days ago.

  1. Support Staff 1 Posted by Feodor Fitsner on 14 Nov, 2020 08:19 PM

    Feodor Fitsner's Avatar

    Visual Studio 2019 image has been just updated: https://www.appveyor.com/updates/2020/11/14/

    There is the latest VS 2019 16.8.1 with .NET 5 and this .NET 5 is the default .NET Core right now.

    I don't know if Microsoft has rushed with .NET 5, but it's a part of VS 2019 16.8 now and the new reality.

    Use global.json to pin .NET Core version to 3.1.x. I sent you PR.

    Hope that helps others as well.

  2. 2 Posted by David Le Bansai... on 14 Nov, 2020 10:03 PM

    David Le Bansais's Avatar

    Thank you for helping me with this issue. The new file works, but after I upgraded to VS 2019 16.8.1 I have some issues building locally. I've decided to make it local to AppVeyor and it's working great.

    Thanks again!

  3. 3 Posted by Travis Hall on 16 Nov, 2020 02:55 AM

    Travis Hall's Avatar

    Hi. I'm adding to this because I seem to have encountered the same issue.

    Adding a global.json file seems to get the build working again, but I'm having no trouble building on my machine using Visual Studio 16.8.1 and .NET SDK 5.0.100. It's only on AppVeyor that I'm having to prevent the use of the latest .NET SDK.

    We aren't deploying on .NET 5 yet (as our target environments do not support it yet) but the new SDK should support builds for .NET Core 2.1 and 3.1, and .NET Framework 4.7 and 4.8, yet?

    I would like us to not be stuck building on the older .NET SDK forever, and if that means we're seeing a real AppVeyor problem, it would be good to get to the bottom of it.

  4. Support Staff 4 Posted by Feodor Fitsner on 16 Nov, 2020 03:03 AM

    Feodor Fitsner's Avatar

    Hi Travis,

    You are building locally from VS IDE, right?

  5. Support Staff 5 Posted by Feodor Fitsner on 16 Nov, 2020 03:08 AM

    Feodor Fitsner's Avatar

    OK, looks like this is the issue: https://developercommunity.visualstudio.com/content/problem/1248649...

    Indeed, we are currently installing NuGet 5.4. I'm going to run some tests and fix the image if this is the case.

  6. Support Staff 6 Posted by Feodor Fitsner on 16 Nov, 2020 05:08 AM

    Feodor Fitsner's Avatar

    Yep, that was NuGet! Now, when the image is updated with NuGet 5.8.0 it should be fine even without global.json.

  7. 7 Posted by Travis Hall on 16 Nov, 2020 07:18 AM

    Travis Hall's Avatar

    Can confirm. Our projects now build correctly. (Actually, we're probably a fairly good test, as our system has a mix of Framework, Core, and Standard projects.)

    Thank you, Feodor.

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