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

Unhandled Exception: System.TypeInitializationException: The type initializer for 'Microsoft.OData.Edm.Vocabularies.V1.CoreVocabularyModel' threw an exception. ---> System.BadImageFormatException: Could not load file or assembly 'System.Reflection, Version=4.0.0.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) ---> System.BadImageFormatException: Cannot load a reference assembly for execution. #2933

Open
kkattamudi-ms opened this issue Apr 13, 2024 · 0 comments

Comments

@kkattamudi-ms
Copy link

Our Service is not running due to a dll loading issue with the Odata library ."Unhandled Exception: System.TypeInitializationException: The type initializer for 'Microsoft.OData.Edm.Vocabularies.V1.CoreVocabularyModel' threw an exception. ---> System.BadImageFormatException: Could not load file or assembly 'System.Reflection, Version=4.0.0.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) ---> System.BadImageFormatException: Cannot load a reference assembly for execution. "

Assemblies affected

  • OData .Net lib 7.5*

Reproduce steps

May be using the OData.Net library with combination of 4.7.2 framework and using the reflection package 4.1.20 or nuget package

Expected result

*It should load the system.reflection package from global assembly cache as 4.0 version exists in GAC

Actual result

It is not able to load the assembly from GAC .

Additional detail

*I dont see any redirects with the Odata code . I am not sure if it needs depedency on system.reflection package or not . If it is required what it should be ?

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

1 participant