使用类型提供程序时出错 'FSharp.Configuration.ResourceProvider'

Error while using type provider 'FSharp.Configuration.ResourceProvider'

我刚刚在 paket 文件中加载 FSharp.Configuration 并使用

创建了一个类型
open FSharp.Configuration
type ResourceProvider = ResXProvider<file="Resources/Strings.resx">

Strings.resx 中是资源,例如:

<data name="Greeting" xml:space="preserve">
    <value>Hello</value>
</data>

一切都编译。 但是,当我使用 ResourceProvider.Greeting 通过提供程序调用该资源时,出现此错误:

error FS3033: The type provider 'FSharp.Configuration.ConfigTypeProvider+FSharpConfigurationProvider' 
reported an error in the context of provided type: 
'FSharp.Configuration.ResXProvider,file="Resources/Strings.resx"', member 'get_Greeting'. 
Error: Method 'System.Object readValue[Object](System.String, System.Reflection.Assembly,
 System.String)' not found in type '<null>'. This method may be missing in the types 
available in the target assemblies.

任何人都可以帮助我解决该错误消息吗?我找不到此消息的解决方案。

谢谢。

编辑:这是一个 .NET 6 项目。

浏览完GitHub repository, I think the problem is that ResXProvider doesn't yet support .NET 5 (let alone .NET 6). The ResXProvider test file has a compiler directive that limits it to .NET 4.6.1, and there's an open issue关于缺少对 .NET Core 的支持。

作为替代方案,我建议改用 Assembly.GetManifestResourceStream