[Kurz erwähnt] Nach der Aktivierung von Code Access Security lässt sich die Powershell nicht mehr starten

Hallo,

aus Kompatibilitätsgründen wurde von einem Kunden temporär die Code Access Security (CAS) auf einem Windows 2012 R2 Server auf LegacySecurityPolicy umgestellt.

Die Konfiguration erfolgte system-global über die Konfigurationsdateien c:\Windows\Microsoft.NET\Framework\<version>\Config\machine.config respektive
c:\Windows\Microsoft.NET\Framework64\<version>\Config\machine.config unter Verwendung von <NetFx40_LegacySecurityPolicy enabled="true"/>.

Im Anschluss wurde festgestellt, dass sich keine .NET-Anwendungen mehr öffnen lassen.

Fehlermeldung:
The shell cannot be started. A failure occurred during initialization:
The type initializer for 'System.Management.Automation.SessionStateScope' threw an exception.

Das Problem trat nur auf Windows Server 2012 R2 auf – nicht unter Windows Server 2008 R2.

Nach kurzer Prüfung wurde festgestellt, das NetFx40_LegacySecurityPolicy nur auf Anwendungsebene konfiguriert werden kann (via Manifest-File).

Viele Grüße,
Matthias Meiling 

This posting is provided "AS IS" with no warranties, and confers no rights.
The entire risk arising out of the use or performance of the sample scripts and documentation remains with you. In no event shall Microsoft, its authors, or anyone else involved in the creation, production, or delivery of the scripts be liable for any damages whatsoever (including, without limitation, damages for loss of business profits, business interruption, loss of business information, or other pecuniary loss) arising out of the use of or inability to use the sample scripts or documentation, even if Microsoft has been advised of the possibility of such damages.