WPF must remove all calls to obsolete .NET 5 APIs before GA.
The obsolete API warnings were temporarily disabled here:
https://github.com/dotnet/wpf/pull/3333/commits/dc7669ed16f96682fefa53e03ee8ef0360c3cd18
The full list of .NET 5 obsolete APIs is here:
https://github.com/dotnet/designs/blob/master/accepted/2020/better-obsoletion/obsoletions-in-net5.md
What is the alternative to CER then? /cc @terrajobst
I also want to point out that the Assembly.CodeBase which WPF uses was marked as obsolete (https://github.com/dotnet/runtime/issues/31127). I am a bit worried about that, does it not affect loading site of origin and/or other components based on uri?
/cc @dotnet/wpf-developers @jeffhandley @danmosemsft
Adding guidance from @jeffhandley. Thanks.
Assembly.CodeBase was used for Code Access Security
That's by runtime. I was trying to suggest WPF is using it for other purposes too. While I understand CAS has been obsoleted, I don't see why if you want the assembly location as Uri you should do extra work with Location, prone to bugs, when there is perfectly working CodeBase property already that does the job. The CodeBase property documentation mentions nothing about CAS, so the relevance for obsoleting it is not clear (and unnecessarily fractures code that targets both FW and Core). I accept though that the decision has been already made; hopefully we can adapt without breaking changes.
@vatsan-madhavan
What is the alternative to CER then? /cc @terrajobst
There is none. You just delete the calls/attribute applications. The feature has never been supported on .NET Core and we don't plan on adding it.
@miloush
Assembly.CodeBase was used for Code Access Security
That's by runtime. I was trying to suggest WPF is using it for other purposes too.
Any reason WPF can't use Assembly.Location instead?
There is none. You just delete the calls/attribute applications.
Simply removing the attributes, suppressing warnings etc. and hoping all would work out well sounds a bit too easy to me.
If CER is not supported, then the code that relied on CER must surely be rewritten in a way that no longer relies upon the guarantees originally promised by CER, wouldn't it? I was expecting this type of guidance to be elaborated as part of the obsoletion docs.
@jkotas do you expect that code written to assume CER may need modification on Core?
The primary reason for CER in .NET Framework was robustness against ThreadAbort. We do not have ThreadAbort in .NET Core. It makes CER unnecessary.
thanks @jkotas & @danmosemsft
Thanks, everyone.
Most helpful comment
The primary reason for CER in .NET Framework was robustness against ThreadAbort. We do not have ThreadAbort in .NET Core. It makes CER unnecessary.