Home Home    Forum    Blog    Feed your aggregator (RSS 2.0)

The Johnnynine Weblog - Running a .Net application from a network share
A weblog by Johnny Hughes
 
 Wednesday, October 10, 2007

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 folder
2. Expand the Machine policy level
3. Expand the Code Groups folder

To modify the polcy to trust a specific strong name:

1. Right click on All_Code, and select New
2. Create a new code group for your strong name, and hit next
3. Select a strong name membership condition from the drop down box
4. 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 unchecked
5. Select the FullTrust permission set

To modify the policy to allow full trust for all Intranet assemblies:

1. Expand the All_Code code group
2. Right click the LocalIntranet_Zone code group, and select properties
3. 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

Wednesday, October 10, 2007 11:23:17 AM (US Mountain Standard Time, UTC-07:00)  #    Comments [0]    | 
Name
E-mail
(will show your gravatar icon)
Home page

Comment (HTML not allowed)  

Enter the code shown (prevents robots):

Copyright © 2010 Johnny Hughes. All rights reserved.
DasBlog 'Portal' theme by Johnny Hughes.