Disclaimer The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.
If you copy a .net application to a network share and try to run it, you will be default get a unhelpful error message.
"... has encountered a problem and needs to close. We are sorry for the inconvenience."
There are at least 2 ways around this:
1. You can use the .NET Framework configuration tool (Mscorcfg.msc) to change the security policy.
For .net 10, 1.1 see: http://support.microsoft.com/kb/832742
For .net 2.0: This is only installed with the SDK, so you'll likely need to use CasPol.exe below.
The easiest way to modify your security policy is by using the Microsoft .NET Framework Configuration utility from the control panel. You can also run this tool from the command line by running mscorcfg.msc. 1. Expand the Runtime Security Policy folder2. Expand the Machine policy level3. Expand the Code Groups folder To modify the polcy to trust a specific strong name: 1. Right click on All_Code, and select New2. Create a new code group for your strong name, and hit next3. Select a strong name membership condition from the drop down box4. Hit the import button, and select your assembly. The configuration tool will import your public key. If you want to trust everything you sign with this key, leave the name and version boxes unchecked5. Select the FullTrust permission set To modify the policy to allow full trust for all Intranet assemblies: 1. Expand the All_Code code group2. Right click the LocalIntranet_Zone code group, and select properties3. Switch to the Permission Set tab, and select FullTrust
The easiest way to modify your security policy is by using the Microsoft .NET Framework Configuration utility from the control panel. You can also run this tool from the command line by running mscorcfg.msc.
1. Expand the Runtime Security Policy folder2. Expand the Machine policy level3. Expand the Code Groups folder
To modify the polcy to trust a specific strong name:
1. Right click on All_Code, and select New2. Create a new code group for your strong name, and hit next3. Select a strong name membership condition from the drop down box4. Hit the import button, and select your assembly. The configuration tool will import your public key. If you want to trust everything you sign with this key, leave the name and version boxes unchecked5. Select the FullTrust permission set
To modify the policy to allow full trust for all Intranet assemblies:
1. Expand the All_Code code group2. Right click the LocalIntranet_Zone code group, and select properties3. Switch to the Permission Set tab, and select FullTrust
2. On the clinet pc you can give full trust access to the whole share which allows running any .net apps frim that share (or just an individual file if you wish) as follows:
CasPol.exe -m -ag 1.2 -url file://storage/files/* FullTrust
See: http://blogs.gotdotnet.com/shawnfa/archive/2004/12/30/344554.aspx
Remember Me