Repository navigation
Open
Open
Copy link
Labels
BugImpact-Low(Internal MS Team use only) Describes an issue with limited impact on existing code.(Internal MS Team use only) Describes an issue with limited impact on existing code.Tracking-External
Milestone
Description
I have an Android C# project that depends on F# projects. When I compile the Android C# project in release mode, I get these warnings:
21>resource ILLink.LinkAttributes.xml in FSharp.Core, Version=7.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a(74,6): Warning IL2008 : FSharp.Core: Could not resolve type 'Microsoft.FSharp.Core.FSharpInterfaceDataVersionLiteralAttribute'.
21>resource ILLink.Substitutions.xml in FSharp.Core, Version=7.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a(3,6): Warning IL2040 : FSharp.Core: Could not find embedded resource 'FSharpOptimizationCompressedData.FSharp.Core' to remove in assembly 'FSharp.Core'.
21>resource ILLink.Substitutions.xml in FSharp.Core, Version=7.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a(5,6): Warning IL2040 : FSharp.Core: Could not find embedded resource 'FSharpSignatureCompressedData.FSharp.Core' to remove in assembly 'FSharp.Core'.
21>resource ILLink.LinkAttributes.xml in FSharp.Core, Version=7.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a(74,6): Warning IL2008 : FSharp.Core: Could not resolve type 'Microsoft.FSharp.Core.FSharpInterfaceDataVersionLiteralAttribute'.
21>resource ILLink.Substitutions.xml in FSharp.Core, Version=7.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a(3,6): Warning IL2040 : FSharp.Core: Could not find embedded resource 'FSharpOptimizationCompressedData.FSharp.Core' to remove in assembly 'FSharp.Core'.
21>resource ILLink.Substitutions.xml in FSharp.Core, Version=7.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a(5,6): Warning IL2040 : FSharp.Core: Could not find embedded resource 'FSharpSignatureCompressedData.FSharp.Core' to remove in assembly 'FSharp.Core'.
21>resource ILLink.LinkAttributes.xml in FSharp.Core, Version=7.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a(74,6): Warning IL2008 : FSharp.Core: Could not resolve type 'Microsoft.FSharp.Core.FSharpInterfaceDataVersionLiteralAttribute'.
21>resource ILLink.Substitutions.xml in FSharp.Core, Version=7.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a(3,6): Warning IL2040 : FSharp.Core: Could not find embedded resource 'FSharpOptimizationCompressedData.FSharp.Core' to remove in assembly 'FSharp.Core'.
21>resource ILLink.Substitutions.xml in FSharp.Core, Version=7.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a(5,6): Warning IL2040 : FSharp.Core: Could not find embedded resource 'FSharpSignatureCompressedData.FSharp.Core' to remove in assembly 'FSharp.Core'.
21>resource ILLink.LinkAttributes.xml in FSharp.Core, Version=7.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a(74,6): Warning IL2008 : FSharp.Core: Could not resolve type 'Microsoft.FSharp.Core.FSharpInterfaceDataVersionLiteralAttribute'.
21>resource ILLink.Substitutions.xml in FSharp.Core, Version=7.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a(3,6): Warning IL2040 : FSharp.Core: Could not find embedded resource 'FSharpOptimizationCompressedData.FSharp.Core' to remove in assembly 'FSharp.Core'.
21>resource ILLink.Substitutions.xml in FSharp.Core, Version=7.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a(5,6): Warning IL2040 : FSharp.Core: Could not find embedded resource 'FSharpSignatureCompressedData.FSharp.Core' to remove in assembly 'FSharp.Core'.
It therefore seems like ILLink.LinkAttributes.xml and ILLink.Substitutions.xml are not fully up to date, and refer to non-existent entities in FSharp.Core.
I'm using FSharp.Core 7.0.300.
Metadata
Metadata
Assignees
Labels
BugImpact-Low(Internal MS Team use only) Describes an issue with limited impact on existing code.(Internal MS Team use only) Describes an issue with limited impact on existing code.Tracking-External
Type
Projects
- StatusShow more project fieldsNew
Activity
vzarytovskii commentedon May 25, 2023
This is kind of by design, since these resources can or cannot be in the assembly, depending on its version and the way it's being distributed - dotnet/runtime#78034
Until we find a proper way of generating xml configs for illink for FSharp.Core, this warning should be suppressed.
thomhurst commentedon Nov 3, 2026
Still reproducible with FSharp.Core 10.1.403 and .NET SDK 10.0.403 on macOS arm64: publishing a minimal F# library consumed by a C# application with
dotnet publish -c Release -p:PublishTrimmed=trueemits IL2040 forFSharpOptimizationInfo.FSharp.Core,FSharpSignatureInfo.FSharp.Core,FSharpOptimizationDataB.FSharp.Core, andFSharpSignatureDataB.FSharp.Core.The F# library only returns an
async { do! Async.Sleep 10 }value. The application references that library and executes the value. Expected: trimming completes without descriptors naming nonexistent resources. The same resource entries remain insrc/FSharp.Core/ILLink.Substitutions.xmlon main. Please make removal of optional resources tolerate their absence.Found while validating TUnit #7526.