Skip to content
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

.NET 5 Compatibility: Code Access Security and Constrained Execution Region are obsolete #21

Closed
FirehawkV21 opened this issue Nov 5, 2020 · 3 comments · Fixed by #25
Milestone

Comments

@FirehawkV21
Copy link
Contributor

FirehawkV21 commented Nov 5, 2020

As I was working on getting .NET 5 support, the compiler threw numerous warnings about two APIs(?): Code Access Security (SYSLIB0003 -> see dotnet/docs#21021) and Constrained Execution Region (SYSLIB0004 -> see https://docs.microsoft.com/en-us/dotnet/core/compatibility/syslib0004).

Now CAS (as I understand the documentation) can be simply put behind a preprocessor #if NETFRAMEWORK (I think .NET Core/.NET 5 runs in full trust only) unless there's a necessity to block access in some cases. CER would be a concern (I'm seeing a lot of ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success)).

Edit: To clarify a bit, the warning are thrown in bits of code like [SecurityPermission(SecurityAction.LinkDemand, Flags = SecurityPermissionFlag.UnmanagedCode)].

@gitjsdr26
Copy link

Since update of Visual Studio 16.8.0, I'm facing numerous errors of kind

Gravité	Code	Description	Projet	Fichier	Ligne	État de la suppression
Erreur	CA2135	'CredentialDialog.ShowDialog()' est protégé avec un LinkDemand pour 'SecurityPermissionAttribute'.
Dans l'ensemble de règles de sécurité de niveau 2, il devrait plutôt être protégé en étant critique de sécurité.
Supprimez le LinkDemand et marquez 'CredentialDialog.ShowDialog()' comme critique de sécurité.
Ookii.Dialogs.Wpf	\Ookii.Dialogs.Wpf\CredentialDialog.cs	386	Actif

@augustoproiete
Copy link
Member

Thanks @acemod13 & @gitjsdr26. These errors have been fixed in PR #25 please review it when you have a chance and let me know if you find any other issue.

I've just released a pre-release NuGet package Ookii.Dialogs.Wpf v3.0.0-preview1 from the same branch as PR @5, targeting .NET 5 (in addition to .NET Core 3.1 and .NET Framework 4.5.

If all goes well, I'll release a final version 2.0.0 and 3.0.0 to NuGet this weekend:

  • v2.0.0: Targets .NET Core 3.1 and .NET Framework 4.5
  • v3.0.0: Targets .NET 5, .NET Core 3.1 and .NET Framework 4.5

@augustoproiete augustoproiete added this to the 3.0.0 milestone Nov 15, 2020
@augustoproiete
Copy link
Member

Closed via #25

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging a pull request may close this issue.

3 participants