Blazor Mono.Linker.LoadException

Blazor Mono.Linker.LoadException

我正在尝试将 .NET Framework 第 3 方 class 库导入到我的 Blazor WASM 应用程序中。我想如果 class 库不受支持,我会得到(如 Blazor 主页上所述)PlatformNotSupportedException 错误。

但是,当我编译我的应用程序时,我收到此错误:

Error Unhandled exception. Mono.Linker.LoadException: Error while processing references of 'LibraryA, Version=1.1.0.0, Culture=neutral, PublicKeyToken=..' C:\Users...nuget\packages\microsoft.aspnetcore.blazor.build.1.0-preview4.19579.2\targets\Blazor.MonoRuntime.targets 204

Error ILLink failed with exited code -532462766. C:\Users...nuget\packages\microsoft.aspnetcore.blazor.build.1.0-preview4.19579.2\targets\Blazor.MonoRuntime.targets 204

这是否意味着我不能使用图书馆?或者我可以配置一些东西让它工作吗?我认为该库至少编译为 .NET v4.5

Blazor implements .NET Standard 2.0. .NET Standard is a formal specification of .NET APIs that are common across .NET implementations.

查看此 like 了解更多详情。

PlatformNotSupportedException 某个功能在特定平台上不 运行 时抛出的异常。

您必须找到适用于 .net Standard 的库