Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

.NET MAUI Support - Fails to Generate NuGet package for Library project. #2919

Closed
josephchrisman opened this issue May 4, 2022 · 10 comments
Closed
Assignees
Labels
More-information-needed More information is needed to progress. The issue will close automatically in 2 weeks. O-Community

Comments

@josephchrisman
Copy link

When attempting to build a .NET MAUI (RC2) library project that includes the Realm NuGet (10.11.2) I get the following error:

  NuGet.Build.Tasks.Pack.targets(221, 5): [NU5026] The file '---/bin/Debug/net6.0-ios/Native.Data.manifest' to be packed was not found on disk.

If I call dotnet build the project will build fine. However, calling dotnet pack causes the above error. I have included a minimal project that is able to reproduce the issue.

Fails to Pack when Realm NuGet included

@nirinchev
Copy link
Member

@fealebenpae or @papafe can you take a look

@nirinchev
Copy link
Member

Actually, I thought we had released #2906. I'm guessing that once we do, this should go away, but might be worth verifying against the provided repro.

@fealebenpae
Copy link
Member

I will take a look at the repro - am already installing rc2 as I'm typing this 😄

@fealebenpae
Copy link
Member

Looking at https://github.com/dotnet/msbuild/blob/main/src/Tasks/Microsoft.Common.CurrentVersion.targets it seems like this file is a generated ClickOnce manifest, which doesn't make any sense. I can't figure out why the Realm package causes it, but the NuGet package from #2906 doesn't exhibit the same issue. I'll go ahead and release it.

@fealebenpae
Copy link
Member

We released 10.12.0 with #2906 - I can't reproduce the issue locally with it, can you try with the release as well?

@jamesmontemagno
Copy link

It would probably be worth adding the ios/android specific identifiers that are bought in by .NET MAUI for .NET 6 ->

net6.0-android;net6.0-ios;net6.0-maccatalyst;net6.0-windows10.0.19041;

at a minimum. Then also adding supported os platforms:

  <PropertyGroup>
    <SupportedOSPlatformVersion Condition="$(TargetFramework.Contains('-ios'))">10.0</SupportedOSPlatformVersion>
    <SupportedOSPlatformVersion Condition="$(TargetFramework.Contains('-tvos'))">10.0</SupportedOSPlatformVersion>
    <SupportedOSPlatformVersion Condition="$(TargetFramework.Contains('-maccatalyst'))">13.1</SupportedOSPlatformVersion>
    <SupportedOSPlatformVersion Condition="$(TargetFramework.Contains('-macos'))">10.14</SupportedOSPlatformVersion>
    <SupportedOSPlatformVersion Condition="$(TargetFramework.Contains('-android'))">21.0</SupportedOSPlatformVersion>
    <SupportedOSPlatformVersion Condition="$(TargetFramework.Contains('-windows10'))">10.0.17763.0</SupportedOSPlatformVersion>
    <TargetPlatformMinVersion Condition="$(TargetFramework.Contains('-windows10'))">10.0.17763.0</TargetPlatformMinVersion>
  </PropertyGroup>

  <PropertyGroup Condition=" $(TargetFramework.StartsWith('uap10.0')) ">
    <TargetPlatformMinVersion>10.0.17763.0</TargetPlatformMinVersion>
  </PropertyGroup>

@fealebenpae
Copy link
Member

We don't have any platform-specific C# code (aside from the bit that helps P/Invoke resolve our bundled native library) - would it still be worth it to multi-target the various flavors of .NET 6 in that case? Does this embed any extra metadata in the assembly or NuGet package that helps consumers?

@jamesmontemagno
Copy link

@fealebenpae Hmmmmm that is a good question @Redth thoughts on that? I know before with Xamarin iOS/Android there were specific libraries I thought you brought in?

It would bring in additional metadata, but isn't needed usually unless you need to access iOS/Android specific APIs. All .NET 6 libraries should be compatible.

@sync-by-unito sync-by-unito bot added Waiting-For-Reporter Waiting for more information from the reporter before we can proceed More-information-needed More information is needed to progress. The issue will close automatically in 2 weeks. labels May 24, 2022
@josephchrisman
Copy link
Author

Following up. I updated the version of Realm in my repro project and it built and packed just fine. So I think it is safe to say the issue is fixed.

@github-actions github-actions bot added Needs-Attention Reporter has responded. Review comment. and removed Waiting-For-Reporter Waiting for more information from the reporter before we can proceed labels Jun 1, 2022
@nirinchev
Copy link
Member

Thanks for confirming! I'll close the issue, but we're always here if you encounter other issues.

@sync-by-unito sync-by-unito bot removed the Needs-Attention Reporter has responded. Review comment. label Jun 1, 2022
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 14, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
More-information-needed More information is needed to progress. The issue will close automatically in 2 weeks. O-Community
Projects
None yet
Development

No branches or pull requests

4 participants