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

.NET Framework 4.8.1 - Failed to resolve assembly: netstandard, Version=2.0.0.0 #901

Open
fandrei opened this issue Mar 26, 2023 · 3 comments

Comments

@fandrei
Copy link

fandrei commented Mar 26, 2023

			var resolver = new DefaultAssemblyResolver();
			var asm = resolver.Resolve(new AssemblyNameReference("netstandard", new Version("2.0")));
			var module = asm.MainModule;

This code successfully resolves the assembly when executed from a .NET 6 app, but it fails in a .NET 4.8.1 app:

Failed to resolve assembly: 'netstandard, Version=2.0.0.0, Culture=neutral, PublicKeyToken=null'
@pengweiqhca
Copy link

Missing PublicKeyToken.

@fandrei
Copy link
Author

fandrei commented Mar 29, 2023

@pengweiqhca that doesn't matter.

@lextm
Copy link

lextm commented Aug 10, 2023

DefaultAssemblyResolver is not able to resolve many assemblies if you check its source code (and BaseAssemblyResolver). You need to add search directories to guide it.

You might read #802 to study a similar case.

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

3 participants