Cannot deploy windows when referencing net6 and ApplicationDisplayVersion < 1.0
See original GitHub issueDescription
When targeting net6.0 in the MAUI project and setting ApplicationDisplayVersion less than 1.0 then then deployment for Windows is not working and throws the error:
Severity Code Description Project File Line Suppression State Error NETSDK1005 Assets file ‘C:\Users\JanDu\source\repos\BugSample\BugSample\obj\project.assets.json’ doesn’t have a target for ‘net6.0-windows10.0.19041.0’. Ensure that restore has run and that you have included ‘net6.0-windows10.0.19041.0’ in the TargetFrameworks for your project. BugSample C:\Program Files\dotnet\sdk\6.0.402\Sdks\Microsoft.NET.Sdk\targets\Microsoft.PackageDependencyResolution.targets 267
At the same time if we do not reference net6.0 then it works (only referencing ios, android, windows) but then unit testing is not possible.
Here is a video: Just if I change the version to 0.1 from 1.0 the solution doesn’t build anymore and restoring nuget packages fails.
My whole team encounters this issue, both with Visual Studio 2022 and Preview.
Steps to Reproduce
- Create new Maui project
- Add targetFramework net6.0
- Set ApplicationDisplayVersion to 0.1
- Run
Link to public reproduction project repository
https://github.com/janduldhardt/issue-1425176615
Version with bug
6.0.486 (current)
Last version that worked well
Unknown/Other
Affected platforms
Windows
Affected platform versions
windows10.0.19041.0
Did you find any workaround?
Set version to 1.0 and above
Relevant log output
NETSDK1005 Assets file 'C:\Users\JanDu\source\repos\BugSample\BugSample\obj\project.assets.json' doesn't have a target for 'net6.0-windows10.0.19041.0'. Ensure that restore has run and that you have included 'net6.0-windows10.0.19041.0' in the TargetFrameworks for your project. BugSample C:\Program Files\dotnet\sdk\6.0.402\Sdks\Microsoft.NET.Sdk\targets\Microsoft.PackageDependencyResolution.targets 267
Issue Analytics
- State:
- Created a year ago
- Comments:8 (1 by maintainers)

Top Related StackOverflow Question
@jfversluis I added a sample repository + a video that shows the problem. https://gifyu.com/image/SEsbg When v1.0 dotnet restore and restoring nugets works perfectly fine. If I then set the version to 0.1 and rebuild the project it stops working. I could reproduce your case, that if I restore the nugets with v1.0 and then just change to v0.1 then I can also start the application but as soon as any kind of restoring happens it fails.
Same problem here. If I change the display version away from 1.0 the build fails with NetSDK1005. Nuget and Dotnet restore does not work.