-
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
Assembly.CodeBase obsoletion is incomplete #42857
Comments
Tagging subscribers to this area: @vitek-karas, @agocke |
Tagging subscribers to this area: @safern, @ViktorHofer |
cc @ericstj |
Looks like @jkotas suggested pragma here: #31127 (comment) Not sure about AssemblyName WRT original issue. Cc @jeffhandley @JoshSchreuder |
At the stage of the release we were in, I think silencing the warnings was reasonable, but I don't think it's a long-term solution. This issue just tracks finishing that long-term work. |
I'd be supportive of adding |
There is one pragma in the shipping code that #42306 is attempting to fix. The remaining pragmas are in method overrides where they are used by design, and in tests. |
I think we should also take a look at code in other repos, like WPF and ASP.NET |
@dotnet/area-system-reflection I spent some time looking into this, but I am not familiar enough with how I moved the issue to 7.0.0, but if time permits before .NET 6 RC1, this would be nice-to-have. |
I don't see much real usage of private static Assembly LoadAssembly(string codeBase)
{
AssemblyName assemblyName = new AssemblyName { CodeBase = assemblyPath };
return Assembly.Load(assemblyName);
} but this code would not work in .Net Core, therefore I think we should obsolete |
Assembly.CodeBase
andAssembly.EscapedCodeBase
were marked obsolete in #31127but this work was incomplete:
AssemblyName.CodeBase
andAssemblyName.EscapedCodeBase
are not marked. In addition, usages of these obsolete APIs remain in the source code.We need to carefully audit all the use-sites and either remove them or provide explicit justification for our continued use.
The text was updated successfully, but these errors were encountered: