Unable to archive app if it references a .NET Standard 2.0 class library
See original GitHub issueDescription
We noticed an issue with a larger project where the code would not archive using the Visual Studio For Mac 2022 GUI. I realize this is possibly a tooling issue, but regardless I think it’s important to raise here.
Given a MauiApp that is ready for release, with no issues I would expect it to be able to be built for Release and able to be Archived, instead the following error occurs:
Assets file '/Users/axemasta/Documents/GitHub/MauiArchiveReproduction/src/MyClassLib/obj/project.assets.json' doesn't have a target for 'net6.0-maccatalyst'. Ensure that restore has run and that you have included 'net6.0-maccatalyst' in the TargetFrameworks for your project.
The project in question is a .net standard 2.0 project, it should have no knowledge of mac catalyst (which coincidentaly is the target on the visual studio gui).
Steps to Reproduce
I have reproduced this issue in a sample repo: MauiArchiveReproduction, reproduce by:
- Building for release
- Selecting “Archive for Publishing”
Link to public reproduction project repository
https://github.com/Axemasta/MauiArchiveReproduction
Version with bug
6.0 Release Candidate 2 or older
Last version that worked well
Unknown/Other
Affected platforms
iOS, macOS
Affected platform versions
All I have tried
Did you find any workaround?
No
Relevant log output
Building ArchiveIssueReproduction (Release)
Build started 06/12/2022 16:53:54.
__________________________________________________
Project "/Users/axemasta/Documents/GitHub/MauiArchiveReproduction/src/MyClassLib/MyClassLib.csproj" (Build target(s)):
Target _BeforeCoreCompileImageAssets:
Directory "obj/Release/net6.0-maccatalyst/actool" doesn't exist. Skipping.
Target _BeforeCoreCompileInterfaceDefinitions:
Skipping target "_BeforeCoreCompileInterfaceDefinitions" because it has no inputs.
Target _BeforeCoreCompileInterfaceDefinitions:
Skipping target "_BeforeCoreCompileInterfaceDefinitions" because it has no inputs.
Target _BeforeCoreCompileInterfaceDefinitions:
Skipping target "_BeforeCoreCompileInterfaceDefinitions" because it has no inputs.
Target _CoreCompileInterfaceDefinitions:
Skipping target "_CoreCompileInterfaceDefinitions" because it has no inputs.
Target _BeforeCoreCompileSceneKitAssets:
Skipping target "_BeforeCoreCompileSceneKitAssets" because it has no inputs.
Target _BeforeCoreCompileSceneKitAssets:
Skipping target "_BeforeCoreCompileSceneKitAssets" because it has no inputs.
Target _BeforeCoreCompileSceneKitAssets:
Skipping target "_BeforeCoreCompileSceneKitAssets" because it has no inputs.
Target _CoreCompileSceneKitAssets:
Skipping target "_CoreCompileSceneKitAssets" because it has no inputs.
Target _BeforeCompileTextureAtlases:
Skipping target "_BeforeCompileTextureAtlases" because it has no inputs.
Target _BeforeCompileTextureAtlases:
Skipping target "_BeforeCompileTextureAtlases" because it has no inputs.
Target _BeforeCompileTextureAtlases:
Skipping target "_BeforeCompileTextureAtlases" because it has no inputs.
Target _CoreCompileTextureAtlases:
Skipping target "_CoreCompileTextureAtlases" because it has no inputs.
Target _BeforeCompileCoreMLModels:
Directory "obj/Release/net6.0-maccatalyst/coremlc" doesn't exist. Skipping.
Target PrepareForBuild:
Creating directory "bin/Release/net6.0-maccatalyst/".
Creating directory "/Users/axemasta/Documents/GitHub/MauiArchiveReproduction/src/MyClassLib/obj/Release/net6.0-maccatalyst/refint/".
Creating directory "obj/Release/net6.0-maccatalyst/ref".
Target ResolvePackageAssets:
/usr/local/share/dotnet/sdk/7.0.100/Sdks/Microsoft.NET.Sdk/targets/Microsoft.PackageDependencyResolution.targets(267,5): error NETSDK1005: Assets file '/Users/axemasta/Documents/GitHub/MauiArchiveReproduction/src/MyClassLib/obj/project.assets.json' doesn't have a target for 'net6.0-maccatalyst'. Ensure that restore has run and that you have included 'net6.0-maccatalyst' in the TargetFrameworks for your project.
Done building target "ResolvePackageAssets" in project "MyClassLib.csproj" -- FAILED.
Done building project "MyClassLib.csproj" -- FAILED.
Build FAILED.
/usr/local/share/dotnet/sdk/7.0.100/Sdks/Microsoft.NET.Sdk/targets/Microsoft.PackageDependencyResolution.targets(267,5): error NETSDK1005: Assets file '/Users/axemasta/Documents/GitHub/MauiArchiveReproduction/src/MyClassLib/obj/project.assets.json' doesn't have a target for 'net6.0-maccatalyst'. Ensure that restore has run and that you have included 'net6.0-maccatalyst' in the TargetFrameworks for your project.
0 Warning(s)
1 Error(s)
Time Elapsed 00:00:00.19
Assets file '/Users/axemasta/Documents/GitHub/MauiArchiveReproduction/src/MyClassLib/obj/project.assets.json' doesn't have a target for 'net6.0-maccatalyst'. Ensure that restore has run and that you have included 'net6.0-maccatalyst' in the TargetFrameworks for your project.
Issue Analytics
- State:
- Created 9 months ago
- Comments:8 (3 by maintainers)

Top Related StackOverflow Question
@breenbob Same result unfortunately, command:
dotnet publish -f:net6.0-ios -c:Release /p:ArchiveOnBuild=true /p:RuntimeIdentifier=ios-arm64Output:
We’ve moved this issue to the Backlog milestone. This means that it is not going to be worked on for the coming release. We will reassess the backlog following the current release and consider this item at that time. To learn more about our issue management process and to have better expectation regarding different types of issues you can read our Triage Process.