question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cannot deploy windows when referencing net6 and ApplicationDisplayVersion < 1.0

See original GitHub issue

Description

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.

https://gifyu.com/image/SEsbg

My whole team encounters this issue, both with Visual Studio 2022 and Preview.

Steps to Reproduce

  1. Create new Maui project
  2. Add targetFramework net6.0
  3. Set ApplicationDisplayVersion to 0.1
  4. 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:open
  • Created a year ago
  • Comments:8 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
janduldhardtcommented, Oct 28, 2022

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

0reactions
VToegelcommented, Aug 4, 2023

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to build .Net MAUI app referencing a standard .Net 6 ...
I have a standard C# class library that's used for a lot of different projects, and I'd like to use it as a...
Read more >
Project property settings in Visual Studio - .NET MAUI
Describes the Visual Studio project properties available to a .NET MAUI app. The properties and settings are related to building the app, ...
Read more >
Troubleshoot .NET Framework targeting errors
This article provides resolutions for MSBuild errors that might occur because of reference issues.
Read more >
MAUI project will not compile for iOS #4976 - ABP Commercial
ABP Framework 5.3.3 MAUI .NET 6.0 .NET MVC backend (API) I have a project that was created last year with 5.3.3 that I'm...
Read more >
Troubleshoot known issues - .NET MAUI
This problem typically results from having an x86 and x64 SDK installed, and the x86 version is being used. Visual Studio and .NET...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found