Wednesday, February 07, 2007

Running .NET Apps from Network Shares

One of my current projects requires that my application run from a network share. Not thinking that this would be a problem, I wrote my application and went to deploy it and amazingly, it didn't run. It threw a security error. After some digging I found out that .NET apps don't run with full trust when running from network shares (thankfully, big security problem if they did). They actually don't run with enough trust to even load the main form.

I found a thread that mentioned the solution: http://www.vbdotnetforums.com/showthread.php?t=1224 . Basically you just need to setup the security.config for the machine to grant full trust to your application. You can do it by hand or you can use the CASPOL utility that comes with .NET framework.

No comments: