0

I am encountering the following error on hosted linux x64 server while running Blazor webassembly asp. .net 7 used. I look forward to your help in this matter.

System.TypeLoadException: Could not load type 'WebAssembly.JSInterop.JSCallInfo' 
from assembly 'Microsoft.JSInterop.WebAssembly, Version=7.0.5.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.
   at Microsoft.JSInterop.WebAssembly.WebAssemblyJSRuntime.InvokeUnmarshalled[T0,T1,T2,TResult]
   (String identifier, T0 arg0, T1 arg1, T2 arg2, Int64 targetInstanceId)
   at Microsoft.JSInterop.WebAssembly.WebAssemblyJSRuntime.InvokeUnmarshalled[TResult]
   (String identifier)
   at Microsoft.AspNetCore.Components.WebAssembly.Hosting.WebAssemblyHostBuilder.
      InitializeNavigationManager(IJSUnmarshalledRuntime jsRuntime)
   at Microsoft.AspNetCore.Components.WebAssembly.Hosting.WebAssemblyHostBuilder..
      ctor(IJSUnmarshalledRuntime jsRuntime, JsonSerializerOptions jsonOptions)
   at Microsoft.AspNetCore.Components.WebAssembly.Hosting.WebAssemblyHostBuilder.
       CreateDefault(String[] args)
   at GprTest.Program.Main(String[] args) in Program.cs:line 11
   at GprTest.Program.<Main>(String[] args)

The solution to the problem I had on a linux x64 server with .net 7 blazor

Sydney_dev
  • 1,448
  • 2
  • 17
  • 24
  • [Similar question may have an answer that works for you.](https://stackoverflow.com/questions/65352012/asp-net-5-typeloadexception-could-not-load-type-webassembly-jsinterop-jscal) Is this error shown in your Blazor WASM app or the ASP.Net Linux app? Looking at the error It looks like the Blazor WASM app. Specifically the line `var builder = WebAssemblyHostBuilder.CreateDefault(args);` Is that the case? – LoneSpawn Jul 11 '23 at 14:06

0 Answers0