OFFICIUM INSERVIO
Your reliable partner for your business software...
Sage 100 blockierte Dateien durch MS-Windows / Blocked files because of MS-Windows
(alle Versionen/all versions)
Samstag, 15. Oktober 2022
Mögliche Ursache: Manuelles Einkopieren von .NET-Assemblies in Sage Ordner
Possible Cause: Manually Copying .NET Assemblies into the Sage Folder
Deutsch
Fehlermeldung/Situation
Der Sage Applikationsserver oder die Sage Anwendung können nicht mehr gestartet werden. Im Windows Ereignisprotokoll ist nachfolgende Fehlermeldung enthalten:
System.NotSupportedException: An attempt was made to load an assembly from a network location which would have caused the assembly to be sandboxed in previous versions of the .NET Framework. This release of the .NET Framework does not enable CAS policy by default, so this load may be dangerous.Siehe https://stackoverflow.com/questions/15238714/net-local-assembly-load-failed-with-cas-policy.
Mögliche Ursache: Manuelles Einkopieren von .NET-Assemblies in Sage Ordner
Insbesondere auf Server Betriebssystemen ist uns dieses Problem vermehrt aufgefallen.
Situation:
Bei einem Kunden mussten nachträgliche Änderungen von .net-Anpassungen ausgerollt werden. Konkret wurde ein MEF-Plugin für den Sage Applikationsserver erstellt.
Die entsprechend geänderten .NET-Assembly-Dateien wurden manuell mit dem Windows Explorer in den entsprechenden Sage \Shared-Ordner einkopiert.
Bei diesem Vorgang markiert Windows die Dateien als "potenziell gefährlich" und setzt ein entsprechendes Bit pro einkopierter Datei.
Konsequenz war, dass der Sage Applikationsserver-Dienst nicht mehr gestartet werden konnte, da dieser alle MEF-Plugins im Sage \Shared-Ordner beim Start des Dienstes per Reflection ermittelt.
Dieses Laden wird nicht in einen "ordentlichen" Exception-Handler gekapselt, wodurch der gesamte Start des Sage Applikationsservers fehlschlägt.
Im Windows Anwendungsprotokoll war o.g. Fehlermeldung zu erkennen.
Mögliche Lösung
Die Dateien können leicht mit einer PowerShell-Anweisung entsperrt werden.
D.h., Abhilfe schafft ein simples, per PowerShell im Admin-Modus ausgeführtes Statement.
Man wechselt zunächst in der PowerShell in den Sage \Shared Ordner.
Danach gibt man folgende Anweisung ein:
>dir *.* -Recurse | Unblock-FileEnglish
Error Message/Situation
The Sage application server or the Sage application can no longer be started.
The following error message is recorded in the Windows Event Log:
System.NotSupportedException: An attempt was made to load an assembly from a network location which would have caused the assembly to be sandboxed in previous versions of the .NET Framework. This release of the .NET Framework does not enable CAS policy by default, so this load may be dangerous.See https://stackoverflow.com/questions/15238714/net-local-assembly-load-failed-with-cas-policy.
Possible Cause: Manually Copying .NET Assemblies into the Sage Folder
This issue has been observed more frequently, particularly on server operating systems.
Situation:
A customer needed to deploy modifications to .NET customisations at a later stage.
Specifically, an MEF plugin was developed for the Sage application server.
The modified .NET assembly files were manually copied into the relevant Sage \Shared folder using Windows Explorer.
During this process, Windows marked the files as "potentially dangerous" and set a corresponding flag on each copied file.
As a consequence, the Sage application server service could no longer start, as it scans all MEF plugins in the Sage \Shared folder via Reflection when the service is launched.
This loading process is not encapsulated within a proper exception handler, causing the entire startup of the Sage application server to fail.
The aforementioned error message could be found in the Windows Application Log.
Possible solution
The files can be easily unlocked using a PowerShell command.
In other words, the issue can be resolved with a simple statement executed in PowerShell with administrative privileges.
First, navigate to the Sage \Shared folder in PowerShell.
Then, enter the following command:
>dir *.* -Recurse | Unblock-File
