Using Magic xpa in a Network Installation (Magic xpa 2.x)
This Technical Note explains how you can use Magic xpa in a network installation.
The .NET runtime security policy (by default) disables code from running if it exists on a network drive. In order to run Magic xpa from a network drive you need to adjust your security policy.
For regular workstations do the following:
Check if you have an EXE file called: caspol.exe in the framework directory, such as: C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\
You can read about Caspol at the following locations:
Open the command line and run one of the following commands:
c:\Windows\Microsoft.NET\Framework\v2.0.50727\caspol.exe -machine -addgroup All_Code -strong -file <path>MgxpaRuntime.exe -noname -noversion FullTrust -name Magicxpa_Assemblies_Access -description "Code group granting trust to Magic xpa assemblies"
Where <path> is the runtime location, such as: ‘z:\magicxpa’.
c:\Windows\Microsoft.NET\Framework\v2.0.50727\caspol.exe -machine -addgroup 1.2 –url file:<path>/* FullTrust -name Magicxpa_Assemblies_Access -description "Code group granting trust to Magic xpa assemblies"
Where <path> is the runtime location in URL format, such as: ‘//gourixp/magicxpa’.
This command needs to be executed only once in each of the computers.
Note that the network mapping might be different, so the file reference should be modified accordingly.
On XP machines, you might need to use the following command:
<path to caspol.exe>\CasPol.exe -m -ag 1.2 -url file://Network_PC_Name/Share_Name/* FullTrust
We recommend creating a batch file that will run the command and then executing the batch file on each workstation.
If you have .NET 2 SDK do the following:
Run: Control Panel\Administrative Tools\Microsoft .NET 2 configuration.
Go to run time security policy\machine\code groups\all_code.
Right-click on all_code and select the New option.
Give the code a name, such as RG, and click Next.
Select URL, specify the URL of the Magic xpa folder with \* (for example: \\gourixp\Magic xpa 2.2\*), and click Next.
Select full trust, click Next and then click Finish.
Don't forget to specify \* after the name.