[BUG] Error NETSDK1005 after changes in .csproj file
See original GitHub issueDescription
I’ve created a new .NET MAUI app using the latest RC1 version. I’m opening the project file of the project and do some changes like chaing the ApplicationTitle
or the ApplicationDisplayVersion
. If I’m now also updating the Color
of the MauiSplashScreen
the app won’t build with the error NETSDK1005
. Also undo the latest changes won’t fix the issue.
Steps to Reproduce
- Create a new .NET MAUI app
- Edit the project file
- Update
ApplicationTitle
,ApplicationDisplayVersion
,Color
ofMauiSplashScreen
Version with bug
Release Candidate 1
Last version that worked well
Unknown/Other
Affected platforms
Android, Windows, I was not able test on other platforms
Affected platform versions
Android 11, Windows 10.0.19041
Did you find any workaround?
Relevant log output
error NETSDK1005: Assets file '\obj\project.assets.json' doesn't have a target for 'net6.0-windows10.0.19041'. Ensure that restore has run and that you have included 'net6.0-windows10.0.19041' in the TargetFrameworks for your project.
Issue Analytics
- State:
- Created a year ago
- Comments:24 (15 by maintainers)
Top Results From Across the Web
NETSDK1005 and NETSDK1047: Asset file is missing target
When the .NET SDK issues error NETSDK1005 or NETSDK1047, the project's assets file is missing information on one of your target frameworks.
Read more >Assets file project.assets.json doesn't have a target for 'net6.0'
For me, this happened after switching from .net6.0 to .net 7.0 in asp.net core / blazor project. The error occured when trying to...
Read more >NuGet Restore build issues - project.assets.json doesn't ...
error NETSDK1005 : Assets file 'C:\git…\obj\project.assets.json' doesn't have a target for 'net48'. Ensure that restore has run and that you ...
Read more >.Net5 - error NETSDK1005: Assets file doesn't have a target
I recently got the error code "NETSDK1005" when i tried to run (dotnet run) my application. Here is how I fixed it.
Read more >MAUI project will not compile for iOS #4976 - ABP Commercial
Currently, when I try to compile the app I get the following error: error NETSDK1005: Assets file 'Z:\Projects\xxxx\aspnet-core\src\xxxx.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@KiristonK did you already try setting
$(ApplicationDisplayVersion)
and$(Version)
to the same value? I don’t see that in your screenshots.The fix for this is not released yet.
I believe that the issue you are seeing @Redth is https://github.com/dotnet/maui/issues/10579 or #12859
This particular one was a result for the TFMs being passed as windows to all dependencies. I moved the code we added back into the workload but nothing changed. And looking at what we have, the code that sets the property is only imported using:
This had a condition for the Windows TFM and the
WindowsAppSDKWinUI
property - which is only set by the Windows App SDK NuGet - after the install has completed. So this never ran on before the restore.I tested this with the latest stable .NET MAUI - 7.0.86 - and I was able to reproduce this by simply updating the 2 properties (only the first matters really):