Skip to content

[S.P.CoreLib]System.Runtime.InteropServices.NFloat._value errors when publish with PublishReadyToRun #79965

Closed

Description

@jkotas

Discussed in #79947

Originally posted by lanyusan December 23, 2022
I am building an Mac desktop app on Mac M1. I got this error as in the title constantly. HELP much appreciated.

I tried to publish with following settings:

  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
    <CodesigningKey>3rd Party Mac Developer Application:[xxxx]</CodesigningKey>
    <PackageSigningKey>3rd Party Mac Developer Installer:[xxxx]</PackageSigningKey>   
    <DebugType>pdbonly</DebugType>
    <Optimize>true</Optimize>
    <OutputPath>bin\Release</OutputPath>
    <ErrorReport>prompt</ErrorReport>
    <WarningLevel>4</WarningLevel>
    <EnableCodeSigning>true</EnableCodeSigning>
    <UseSGen>true</UseSGen>
    <UseRefCounting>true</UseRefCounting>
    <CodesignEntitlements>Entitlements.plist</CodesignEntitlements>
    <CreatePackage>false</CreatePackage>
    <EnablePackageSigning>false</EnablePackageSigning>
    <AOTMode>None</AOTMode>
	<PublishReadyToRun>true</PublishReadyToRun>
	<RuntimeIdentifier>osx-x64</RuntimeIdentifier>
  </PropertyGroup>

and publish command:

dotnet publish -c release

I got following errors:

/usr/local/share/dotnet/sdk/7.0.101/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.CrossGen.targets(465,5): error : Error: [S.P.CoreLib]System.Runtime.InteropServices.NFloat._value [/Users/fqye/projects/layer-mixer-avalonia/LayerMixer.csproj]
/usr/local/share/dotnet/sdk/7.0.101/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.CrossGen.targets(465,5): error : System.NotImplementedException: [S.P.CoreLib]System.Runtime.InteropServices.NFloat._value [/Users/fqye/projects/layer-mixer-avalonia/LayerMixer.csproj]
/usr/local/share/dotnet/sdk/7.0.101/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.CrossGen.targets(465,5): error :    at ILCompiler.DependencyAnalysis.ReadyToRun.ModuleTokenResolver.GetModuleTokenForField(FieldDesc field, Boolean throwIfNotFound) [/Users/fqye/projects/layer-mixer-avalonia/LayerMixer.csproj]
/usr/local/share/dotnet/sdk/7.0.101/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.CrossGen.targets(465,5): error :    at ILCompiler.DependencyAnalysis.ReadyToRun.FieldFixupSignature.GetData(NodeFactory factory, Boolean relocsOnly) [/Users/fqye/projects/layer-mixer-avalonia/LayerMixer.csproj]
/usr/local/share/dotnet/sdk/7.0.101/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.CrossGen.targets(465,5): error :    at ILCompiler.DependencyAnalysis.ReadyToRun.ImportSectionNode.MaterializeSignature(NodeFactory r2rFactory) [/Users/fqye/projects/layer-mixer-avalonia/LayerMixer.csproj]
/usr/local/share/dotnet/sdk/7.0.101/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.CrossGen.targets(465,5): error :    at ILCompiler.DependencyAnalysis.ReadyToRun.ImportSectionsTableNode.MaterializeSignature() [/Users/fqye/projects/layer-mixer-avalonia/LayerMixer.csproj]
/usr/local/share/dotnet/sdk/7.0.101/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.CrossGen.targets(465,5): error :    at ILCompiler.DependencyAnalysis.ReadyToRun.ManifestMetadataTableNode.ComputeLastSetOfModuleIndices() [/Users/fqye/projects/layer-mixer-avalonia/LayerMixer.csproj]
/usr/local/share/dotnet/sdk/7.0.101/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.CrossGen.targets(465,5): error :    at ILCompiler.DependencyAnalysis.ReadyToRun.ManifestMetadataTableNode.GetManifestAssemblyMvidTableData() [/Users/fqye/projects/layer-mixer-avalonia/LayerMixer.csproj]
/usr/local/share/dotnet/sdk/7.0.101/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.CrossGen.targets(465,5): error :    at ILCompiler.DependencyAnalysis.ReadyToRun.ManifestAssemblyMvidHeaderNode.GetData(NodeFactory factory, Boolean relocsOnly) [/Users/fqye/projects/layer-mixer-avalonia/LayerMixer.csproj]
/usr/local/share/dotnet/sdk/7.0.101/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.CrossGen.targets(465,5): error :    at ILCompiler.DependencyAnalysis.ReadyToRunObjectWriter.EmitPortableExecutable() [/Users/fqye/projects/layer-mixer-avalonia/LayerMixer.csproj]
/usr/local/share/dotnet/sdk/7.0.101/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.CrossGen.targets(465,5): error :    at ILCompiler.ReadyToRunCodegenCompilation.Compile(String outputFile) [/Users/fqye/projects/layer-mixer-avalonia/LayerMixer.csproj]
/usr/local/share/dotnet/sdk/7.0.101/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.CrossGen.targets(465,5): error :    at ILCompiler.Program.RunSingleCompilation(Dictionary`2 inFilePaths, InstructionSetSupport instructionSetSupport, String compositeRootPath, Dictionary`2 unrootedInputFilePaths, HashSet`1 versionBubbleModulesHash, CompilerTypeSystemContext typeSystemContext) [/Users/fqye/projects/layer-mixer-avalonia/LayerMixer.csproj]
/usr/local/share/dotnet/sdk/7.0.101/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.CrossGen.targets(465,5): error :    at ILCompiler.Program.Run(String[] args) [/Users/fqye/projects/layer-mixer-avalonia/LayerMixer.csproj]
/usr/local/share/dotnet/sdk/7.0.101/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.CrossGen.targets(465,5): error :    at ILCompiler.Program.Main(String[] args) [/Users/fqye/projects/layer-mixer-avalonia/LayerMixer.csproj]
/usr/local/share/dotnet/sdk/7.0.101/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.CrossGen.targets(353,5): error NETSDK1096: Optimizing assemblies for performance failed. You can either exclude the failing assemblies from being optimized, or set the PublishReadyToRun property to false. [/Users/fqye/projects/layer-mixer-avalonia/LayerMixer.csproj]
```</div>

Activity

  1. ghost added
    untriagedNew issue has not been triaged by the area owner
    on Dec 25, 2022
  2. lanyusan commented on Dec 26, 2022

    @lanyusan

    I have created a reproducer.

    Clone https://github.com/lanyusan/dotnet-publish-bug.git

    Run: dotnet publish -c release -r osx-x64 --self-contained true -p:UseAppHost=true -p:PublishReadyToRun=true

  3. removed
    untriagedNew issue has not been triaged by the area owner
    on Jul 24, 2023
  4. added this to the 8.0.0 milestone on Jul 24, 2023
  5. trylek commented on Aug 8, 2023

    @trylek
    Member

    I believe this should be fixed in .NET 8. I tried the repro locally and it worked for me; @davidwrighton substantially refactored the token resolver in #73663 so I assume the bug was either fixed by his change or by an independent change before that. Please note that @lanyusan's repro uses .NET 6, many things have been fixed since then. Closing for now, please reopen if it still reproes with .NET 8.

  6. ghost locked as resolved and limited conversation to collaborators on Sep 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions