-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
Assembly.Load with null Version #4467
Comments
It looks like a bug to me that we should fix. |
We need this to be fixed before we can start running Roslyn tests on CoreCLR. |
@kouvel, could you please take a look? |
Sure, I'll take a look |
cc @gkhanna79 |
There was some discussion over email regarding this that wasn't captured here. A main point was that assemblies on the TPA list (everything residing next to CoreRun) must have a version specified in order to be loaded. That seems to be the relevant part of the logic involved here. |
….execution.dotnet.dll to work around dotnet/coreclr#1477
I'm curious about the behavior of Assembly.Load(AssemblyName) when the given AssemblyName has a null Version property. It seems that, when trying to load an unsigned assembly (no public key), you must assign something to the Version property; even 0.0.0.0 works. For example, the following doesn't work:
but the following does. The second one works because the assembly is signed.
Do we have documentation regarding this behavior? It seems a little counter-intuitive to me.
This came up because the latest beta version of xUnit attempts to load assemblies by calling Assembly.Load(new AssemblyName() { Name = ..., Version = null }). Actually it's slightly different than that, but that's the gist of it: https://github.com/xunit/xunit/blob/master/src/common/SerializationHelper.cs#L166.
cc: @jkotas , @nguerrera , @weshaggard
The text was updated successfully, but these errors were encountered: