[V2] Could not load file or assembly System.Numerics.Vectors

Discuss any questions about BEPUphysics or problems encountered.
Post Reply
AlexCereus
Posts: 6
Joined: Fri Feb 15, 2019 2:03 pm

[V2] Could not load file or assembly System.Numerics.Vectors

Post by AlexCereus » Wed Feb 20, 2019 8:38 am

Hello.

I try to use BepuPhysics with Photon Server. When I run my app, it logs error:

ERROR Photon.SocketServer.ApplicationBase [(null)] - System.BadImageFormatException: Could not load file or assembly 'System.Numerics.Vectors, Version=4.1.3.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. Reference assemblies should not be loaded for execution. They can only be loaded in the Reflection-only loader context. (Exception from HRESULT: 0x80131058)

Please help.

KakCAT
Posts: 22
Joined: Mon Apr 14, 2014 2:08 pm

Re: [V2] Could not load file or assembly System.Numerics.Vectors

Post by KakCAT » Wed Feb 20, 2019 11:32 am

Hi Alex,

I don't know if this is the case, but BadImageFormatException is very often a problem when mixing 32 bits and 64 bits:

https://stackoverflow.com/questions/159 ... on-c-sharp

Norbo
Site Admin
Posts: 4587
Joined: Tue Jul 04, 2006 4:45 am

Re: [V2] Could not load file or assembly System.Numerics.Vectors

Post by Norbo » Thu Feb 21, 2019 12:11 am

In .NET standard projects, nuget sometimes pulls down 'dummy' dependencies. They provide the same API as the full implementation and provide all the same reflection features but don't contain any implementation details. When a .NET Standard project is consumed by an application, the application project pulls down non-dummy dependencies specific to the application's framework.

In this case, it looks like the dummy dependencies are being directly referenced and the runtime is unhappy about it. You'll need to find a compatible version of the dependency to use. VS's package manager will automatically resolve this sort of thing, but if you're working outside the package manager you'll have to do it manually.

Post Reply

Who is online

Users browsing this forum: No registered users and 4 guests