My .Net MAUI project builds and runs fine when in the debug configuration. However, when I switch to Release configuration I get the following errors
1>------ Build started: Project: MyProject, Configuration: Release Any CPU ------ NuGet package restore failed. Please see Error List window for detailed warnings and errors. 1>C:\Program Files\dotnet\sdk\7.0.202\Sdks\Microsoft.NET.Sdk\targets\Microsoft.PackageDependencyResolution.targets(266,5): error NETSDK1005: Assets file 'C:\Users\XXXX\source\repos\MyProject\MyProject\obj\project.assets.json' doesn't have a target for 'net7.0'. Ensure that restore has run and that you have included 'net7.0' in the TargetFrameworks for your project. 1>Done building project "MyProject.csproj" -- FAILED. 1>C:\Program 1>C:\Program Files\dotnet\sdk\7.0.202\Sdks\Microsoft.NET.Sdk\targets\Microsoft.PackageDependencyResolution.targets(266,5): error NETSDK1005: Assets file 'C:\Users\XXXX\source\repos\MyProject\MyProject\obj\project.assets.json' doesn't have a target for 'net7.0-android'. Ensure that restore has run and that you have included 'net7.0-android' in the TargetFrameworks for your project. 1>Done building project "MyProject.csproj" -- FAILED.
The project.assets.json targets section is empty.
If I build the app from the PowerShell, using dotnet build -c RELEASE, the app builds fine.
Any suggestions?