Reputation: 323
This is where VS drives me crazy. I have a solution that has a .NET MAUI Hybrid project, plus a Class Library project. All was fine and I was able to deploy it about 5 times, and then all of a sudden I started getting this dreaded error:
Assets file doesn't have a target for 'net8.0'...but this is for the Class Library project. That project file contains the following:
<TargetFramework>net8.0</TargetFramework>
I have tried to change that to Frameworks...but that didn't help. The main MAUI project contains the following lines:
<TargetFrameworks>net8.0-android;net8.0-ios;net8.0-maccatalyst</TargetFrameworks>
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows'))">$(TargetFrameworks);net8.0-windows10.0.19041.0</TargetFrameworks>
I have cleaned both projects...and yes, I have run 'dotnet restore' multiple times. The Class Library actually does not have any NuGet packages...its just a project of classes.
Any other thoughts on this one?
Upvotes: 0
Views: 99
Reputation: 323
So, not totally sure but it is Visual Studio, so who knows. I rebooted a few times, cleaned out the bin and obj for both the main MAUI app and the Class Library it references. Rebooted again. Then after bringing VS up, I tried to just run debug in Windows, but failed stating that my Class Library couldn't deploy do DEV. Of course not, its a Class Library.
To fix that I had to change the default app identifier from com.companyname.appXXXXXX to something else.
Finally got it all working again.
Upvotes: 0