我创建了一个新的 ASP.NET 5 MVC Web 应用程序,它托管了一个带有一些 .net blazor wasm 组件的 razor 类库和一个名为 Elsa 的第 3 方库。一切似乎都正常,但是当我尝试加载 Elsa 主页时,出现以下错误:
TypeLoadException: Generic method or method in generic class is internal call, PInvoke, or is defined in a COM Import class.
Unknown location
TypeLoadException: Could not load type 'WebAssembly.JSInterop.JSCallInfo' from assembly 'Microsoft.JSInterop.WebAssembly, Version=5.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60' because it contains an object field at offset 4 that is incorrectly aligned or overlapped by a non-object field.
Unknown location
ReflectionTypeLoadException: Unable to load one or more of the requested types.
Generic method or method in generic class is internal call, PInvoke, or is defined in a COM Import class.
Could not load type 'WebAssembly.JSInterop.JSCallInfo' from assembly 'Microsoft.JSInterop.WebAssembly, Version=5.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60' because it contains an object field at offset 4 that is incorrectly aligned or overlapped by a non-object field.
System.Reflection.RuntimeModule.GetTypes(RuntimeModule module)
有点迷失在这个...不知道为什么常规 MVC 页面正在加载,但不是第 3 方 MVC 库。我相信 Elsa 是为 .NET Standard 2.1 编译的。