Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Could not load file or assembly System.Numeric.Vectors exception #4

Closed
Imaver opened this issue May 10, 2019 · 6 comments
Closed

Could not load file or assembly System.Numeric.Vectors exception #4

Imaver opened this issue May 10, 2019 · 6 comments

Comments

@Imaver
Copy link

Imaver commented May 10, 2019

Could you please kindly solve the issue with the dependencies? I have it reproduced after successfully installed NuGet packages and trying to run the program. This is a runtime error, the project compiles successfully.

Could not load file or assembly 'System.Numerics.Vectors, Version=4.1.3.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)

@vpenades
Copy link
Owner

Which version of SharpGLTF are you using?
Which framework are you targeting? I suspect NetFramework 4.6 or 4.7?
Is your csproj old style, or the new SDK style?

You can try one of those solutions:

https://github.com/dotnet/corefx/issues/30106#issuecomment-395185748

Let me know if it solves your issue

@Imaver
Copy link
Author

Imaver commented May 10, 2019

Thank you for such a quick reply!

SharpGLTF version 1.0.0-alpha007
Framework 4.7.1 also just reproduced the difficulty with 4.7.2
old style of the csproj

Thank you for the solutions link, I've tried them previously I will double check them again now.
Keep you updated

@vpenades
Copy link
Owner

I've just created a console app test project, old style, targeting net471 and it seems to be working fine.

I've seen similar issues when the main application, or another dependency, is also using System.Numerics.Vectors, or even worse, a different version of system.Numerics.Vectors.... in that case, the first dependency that needs System.Numerics.Vectors loads it successfully, and all others fail.

This all happens because old style csproj arranges the dependencies to require the exact version match.

New SDK csproj is more friendly about dependencies, so, if it's possible for you to switch to new SDK csproj style, it might solve your problem.

@Imaver
Copy link
Author

Imaver commented May 12, 2019

vpenades,
Thank you very much for the useful link and for the extensive explanation.

In my specific case, I needed to include a dependent assembly configuration in the starting project.
If the same configuration is applied in a newly created library with SharpGltf referenced that was part of the solution - it didn't work.

So in case somebody experiences something similar - make sure that dependendAssembly is configured correctly in your starting project inside. App.config file

Use this example:

<dependentAssembly> <assemblyIdentity name="System.Numerics.Vectors" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> <bindingRedirect oldVersion="0.0.0.0-4.1.4.0" newVersion="4.1.4.0" /> </dependentAssembly>

@Imaver Imaver closed this as completed May 12, 2019
@vpenades
Copy link
Owner

Hi @Imaver

I've just uploaded new packages of SharpGLTF. I while ago I realized that Net.Standard 2,0 allows for implicit System.Numeric.Vectors dependency, so there's no need to explicitly reference system.numerics vectors.

You can try the latest packages (Alpha0008) and see if it solves your problem.

@Imaver
Copy link
Author

Imaver commented May 24, 2019

Hi @vpenades,
Thank you very much for keeping me up to date!
I will check the new version

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants