.net core &引用;runreadytoruncompiler";发布单个文件问题对象时.net core 3.1出错

.net core &引用;runreadytoruncompiler";发布单个文件问题对象时.net core 3.1出错,.net-core,publishing,.net Core,Publishing,我有一个F#项目,我是这样构建的: dotnet发布--nologo-r osx-x64-c发布--自包含true/p:PublishSingleFile=true/p:PublishTrimmed=true/p:PublishReadyToRun=true 我得到了这几页: RUNREADYTORUNCOMPILER : warning : Could not load type 'System.Resources.IResourceWriter' from assembly 'System.

我有一个F#项目,我是这样构建的:

dotnet发布--nologo-r osx-x64-c发布--自包含true/p:PublishSingleFile=true/p:PublishTrimmed=true/p:PublishReadyToRun=true

我得到了这几页:

RUNREADYTORUNCOMPILER : warning : Could not load type 'System.Resources.IResourceWriter' from assembly 'System.Text.RegularExpressions, Version=4.2.2.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. while resolving 0x10000ce - System.Resources.IResourceWriter. [/Users/thomas/Projects/test/test.fsproj]
RUNREADYTORUNCOMPILER : warning : Could not load type 'System.Text.Encodings.Web.JavaScriptEncoder' from assembly 'System.Memory, Version=4.2.1.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'. while resolving 0x2000045 - System.Text.Json.JsonWriterOptions. [/Users/thomas/Projects/test/test.fsproj]
RUNREADYTORUNCOMPILER : warning : Could not load type 'System.Text.Encodings.Web.JavaScriptEncoder' from assembly 'System.Memory, Version=4.2.1.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'. while resolving 0x2000046 - System.Text.Json.Utf8JsonWriter. [/Users/thomas/Projects/test/test.fsproj]
RUNREADYTORUNCOMPILER : warning : Could not load type 'System.Text.Encodings.Web.JavaScriptEncoder' from assembly 'System.Memory, Version=4.2.1.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'. while resolving 0x1000011 - System.Text.Encodings.Web.JavaScriptEncoder. [/Users/thomas/Projects/test/test.fsproj]
RUNREADYTORUNCOMPILER : warning : Could not load type 'System.Text.Encodings.Web.TextEncoder' from assembly 'System.Memory, Version=4.2.1.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'. while resolving 0x10000ad - System.Text.Encodings.Web.TextEncoder. [/Users/thomas/Projects/test/test.fsproj]
RUNREADYTORUNCOMPILER : warning : Could not load type 'System.Text.Encodings.Web.TextEncoder' from assembly 'System.Memory, Version=4.2.1.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'. while resolving 0xa00023c - System.Text.Encodings.Web.TextEncoder.FindFirstCharacterToEncodeUtf8. [/Users/thomas/Projects/test/test.fsproj]
RUNREADYTORUNCOMPILER : warning : Could not load type 'System.Text.Encodings.Web.TextEncoder' from assembly 'System.Memory, Version=4.2.1.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'. while resolving 0xa00023f - System.Text.Encodings.Web.TextEncoder.FindFirstCharacterToEncode. [/Users/thomas/Projects/test/test.fsproj]
这个错误意味着什么

我有另一个项目,我建立了完全相同的命令行没有任何问题

如果我删除单文件属性,那么它将正确构建


如何对此进行故障排除?错误消息并不能真正解释发生了什么。

将此添加到项目文件以修复JavaScriptEncoder:

<TrimmerRootAssembly Include="System.Text.Encodings.Web" />

这是给IResourceWriter的:

<TrimmerRootAssembly Include="System.Resources.Writer" />

ReadyToRun有时需要帮助(或者它只是一辆小车)了解要包含的内容,您可以阅读更多内容