You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Assembly.CodeBase and Assembly.EscapedCodeBase were marked obsolete in #31127
but this work was incomplete: AssemblyName.CodeBase and AssemblyName.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.
I'd be supportive of adding AssemblyName.CodeBase and AssemblyName.EscapedCodeBase into the same obsoletion diagnostic id in 6.0 and also taking a sweep through our own usage to remove the #pragmas.
sweep through our own usage to remove the #pragmas
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.
@dotnet/area-system-reflection I spent some time looking into this, but I am not familiar enough with how AssemblyName is being used to determine the right path forward here.
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 CodeBase in source.dot.net, mostly setting the property from passed AssemblyName to the newly created/cloned AssemblyName. There is a few usage that try to load the assembly by setting CodeBase and seems it was the main functional usage:
but this code would not work in .Net Core, therefore I think we should obsolete CodeBase/EscapedCodeBase and let developers avoid from issues like: AssemblyName.CodeBase is ignored in LoadFromAssemblyName while porting their app from .Net framework
ghost added
in-prThere is an active PR which will close this issue when it is merged
Activity
agocke commentedon Sep 29, 2020
cc @ericstj
ericstj commentedon Sep 29, 2020
Looks like @jkotas suggested pragma here: #31127 (comment)
Not sure about AssemblyName WRT original issue. Cc @jeffhandley @JoshSchreuder
agocke commentedon Sep 29, 2020
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.
jeffhandley commentedon Sep 29, 2020
I'd be supportive of adding
AssemblyName.CodeBaseandAssemblyName.EscapedCodeBaseinto the same obsoletion diagnostic id in 6.0 and also taking a sweep through our own usage to remove the#pragmas.jkotas commentedon Sep 29, 2020
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.
2 remaining items
jeffhandley commentedon Aug 1, 2021
@dotnet/area-system-reflection I spent some time looking into this, but I am not familiar enough with how
AssemblyNameis being used to determine the right path forward here.I moved the issue to 7.0.0, but if time permits before .NET 6 RC1, this would be nice-to-have.
buyaa-n commentedon Jun 9, 2022
I don't see much real usage of
CodeBaseinsource.dot.net, mostly setting the property from passedAssemblyNameto the newly created/clonedAssemblyName. There is a few usage that try to load the assembly by settingCodeBaseand seems it was the main functional usage:but this code would not work in .Net Core, therefore I think we should obsolete
CodeBase/EscapedCodeBaseand let developers avoid from issues like: AssemblyName.CodeBase is ignored in LoadFromAssemblyName while porting their app from .Net framework