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: warning : The file '~/.nuget/packages/fsharp.core/6.0.0/contentFiles/any/netstandard2.1/FSharp.Core.xml' does not specify a 'PublishFolderType' metadata, and a default value could not be calculated. The file will not be copied to the app bundle. #14939

Closed
rolfbjarne opened this issue May 9, 2022 · 2 comments · Fixed by #17908
Labels
enhancement The issue or pull request is an enhancement
Milestone

Comments

@rolfbjarne
Copy link
Member

rolfbjarne commented May 9, 2022

Repro:

  • Build monotouch-test for macOS:

      cd tests/monotouch-test/dotnet/macOS
      make build
      ...
      [...]/xamarin-macios/builds/downloads/dotnet-sdk-6.0.301-[...]/packs/Microsoft.macOS.Sdk/12.3.0[...]/targets/Xamarin.Shared.Sdk.targets(1439,3): warning : The file '[...]/xamarin-macios/tests/dotnet/packages/fsharp.core/6.0.0/contentFiles/any/netstandard2.1/FSharp.Core.xml' does not specify a 'PublishFolderType' metadata, and a default value could not be calculated. The file will not be copied to the app bundle. [[...]/xamarin-macios/tests/monotouch-test/dotnet/macOS/monotouch-test.csproj]
    

Binlog: build-2022-05-09-145149.binlog.zip

The reason is that the FSharp.Core NuGet does this in its nuspec:

<contentFiles>
  <files include="**/FSharp.Core.xml" buildAction="None" copyToOutput="true" flatten="true" />
</contentFiles>

which seems to come from here: dotnet/fsharp#10579 ("Following this change, build and publish will deploy the FSharp.Core.xml doc comment file to the output directory, without the build author having to do any extra work.")

It seems this could be a workaround (untested, from dotnet/fsharp#11143 (comment))

<ItemGroup>
    <PackageReference Update="FSharp.Core" Version="5.0.1">
        <ExcludeAssets>contentFiles</ExcludeAssets>
    </PackageReference>
</ItemGroup>

An alternative solution would be to amend our logic that figures out what to do with files in ResolvedFileToPublish (https://github.com/xamarin/xamarin-macios/blob/main/dotnet/BundleContents.md), to say something like: "If an xml file matches the filename of any assembly, then treat that xml file as PublishFolderType=Assembly" - so FSharp.Core.xml would be placed next to FSharp.Core.dll (and no warning produced). The downside is that the app would ship a file it doesn't need.

See also #15897 (comment).

@mattjohnsonpint
Copy link

FYI, I have a slightly different issue with the same symptom, and was able to work around it. See dotnet/maui#7272 (comment)

@jwosty
Copy link

jwosty commented Oct 21, 2022

Potentially related to fsprojects/Paket#4149

rolfbjarne added a commit to rolfbjarne/xamarin-macios that referenced this issue Mar 27, 2023
…Fixes xamarin#14939 and fixes xamarin#15897.

This fixes a warning when documentation is enabled for a project:

> The file '~/.nuget/packages/fsharp.core/6.0.0/contentFiles/any/netstandard2.1/FSharp.Core.xml' does not specify a 'PublishFolderType' metadata, and a default value could not be calculated. The file will not be copied to the app bundle.

This doesn't change any behavior (as the warning says, the file wasn't copied
to the app bundle before either), but it makes the behavior explicitly
documented and silences the warning.

Fixes xamarin#14939.
Fixes xamarin#15897.
rolfbjarne added a commit that referenced this issue Mar 30, 2023
…ixes #14939 and fixes #15897. (#17908)

This fixes a warning when documentation is enabled for a project:

> The file '~/.nuget/packages/fsharp.core/6.0.0/contentFiles/any/netstandard2.1/FSharp.Core.xml' does not specify a 'PublishFolderType' metadata, and a default value could not be calculated. The file will not be copied to the app bundle.

This doesn't change any behavior (as the warning says, the file wasn't copied
to the app bundle before either), but it makes the behavior explicitly
documented and silences the warning.

Fixes #14939.
Fixes #15897.
@ghost ghost locked as resolved and limited conversation to collaborators Apr 29, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement The issue or pull request is an enhancement
Projects
None yet
3 participants