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.Runtime.InteropServices.RuntimeInformation, Version=4.0.2.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. #75

Closed
Cloudmersive opened this issue Nov 8, 2020 · 6 comments
Milestone

Comments

@Cloudmersive
Copy link

When using MedallionShell together with .NET Framework 4.7.2, it is sporadically generating file not found errors for:

Could not load file or assembly 'System.Runtime.InteropServices.RuntimeInformation, Version=4.0.2.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies.

With this call stack:

System.IO.FileNotFoundException:
at Medallion.Shell.PlatformCompatibilityHelper.get_IsWindows (MedallionShell, Version=1.6.0.0, Culture=neutral, PublicKeyToken=null)
at Medallion.Shell.PlatformCompatibilityHelper.WrapStandardInputStreamIfNeeded (MedallionShell, Version=1.6.0.0, Culture=neutral, PublicKeyToken=null)
at Medallion.Shell.ProcessCommand..ctor (MedallionShell, Version=1.6.0.0, Culture=neutral, PublicKeyToken=null)
at Medallion.Shell.Shell.Run (MedallionShell, Version=1.6.0.0, Culture=neutral, PublicKeyToken=null)

The cause appears to be that a reference to the System.Runtime.InteropServices.RuntimeInformation assembly conflicts with the version of System.Runtime.InteropServices.RuntimeInformation included in .NET Framework 4.7.2 and later

@madelson
Copy link
Owner

madelson commented Nov 8, 2020

@Cloudmersive did you try adding a binding redirect in your app/web.config file?

I'm kind of surprised that you would be hitting this because the latest version of that library (which we are using) does not have different builds for different versions .NET framework. It just has one build for net45.

If the binding redirect doesn't solve the issue for you, I can publish a new version of MedallionShell that has a specific build for net471 that will just use the "in-box" version of RuntimeInformation.

@Cloudmersive
Copy link
Author

@madelson Thanks for the quick response. Yeah, we have been trying binding redirects but it is still happening. If you could add a 471+ build that used the "in-box" version of RuntimeInformation that would be great as that should fix the issue.

@madelson
Copy link
Owner

madelson commented Nov 9, 2020

@Cloudmersive ok I've published a prerelease version containing the new build: https://www.nuget.org/packages/MedallionShell/1.6.2-rc01

Mind testing it out and letting me know if it fixes your issue? If so, I'll issue a stable release.

@madelson madelson added this to the 1.6.2 milestone Nov 9, 2020
@Cloudmersive
Copy link
Author

Thank you @madelson - will test this week!

@Cloudmersive
Copy link
Author

@madelson Release looks good!

madelson added a commit that referenced this issue Nov 15, 2020
Added net471 build in attempt to fix #75
@madelson
Copy link
Owner

Thanks! Published stable version here: https://www.nuget.org/packages/MedallionShell/1.6.2

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