-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
System.NotSupportedException : Assembly.Load with a Codebase is not supported. #7752
Comments
If you call Assembly.GetName() for a loaded assembly the returned AssemblyName object has its CodeBase property set to url based location of assembly. If you use the same AssemblyName object and pass it to Assembly.Load(AssemblyName n) then it fails saying Load using CodeBase is not supported. In my opinion this is not good experience. I have two options to fix this:
I would prefer option 1 but this could be problematic for desktop compat. or do you think it does not give much value to fix this and should stay the way it is? @jkotas @gkhanna79 Let me know your thoughts |
There is also Another option is to turn AssemblyName loads with CodeBase property set into LoadFrom. E.g. the following works in desktop:
Any reason to not do that?
I do not think you would ever want to mutate the AssemblyName passed in. You would want to create a copy if we want with this option.
Yes, both |
We have already diverged a lot in behavior compared to desktop in Load* apis. So trying to do what desktop does should not be a goal I think. I feel it is better to be explicit between Load & LoadFrom and not combine the two. It is more simpler to explain & understand. So I am planning to go with this approach
|
Sounds good. |
Either Assembly.GetName() should not set Codabase property or LoadFromAssemblyName should ignore CodeBase property in AssemblyName
The text was updated successfully, but these errors were encountered: