14 July 2009

Why does "My Application" crash when starting it from a Network Drive/Share?

I've seen a lot of applications that works from local drive and doesn't from Network Drive or Share. When trying to run some of those applications from a network drive/share, you could get an error message like the following:

"Application has generated an exception that could not be handled", or
"Application has encountered a problem and needs to close".


Recently I was requested to make one application working from Network Drive.
When I tested this application, I’ve found that it requires a .NET Framework installed on the computer. But by default, Microsoft .NET Framework disallows running .NET applications from a network drive/share.

To make everybody "Happy", I was needed to do some Security Policy changes. To do that, I've used a Code Access Security Policy Tool (Caspol.exe). In my case Caspol.exe located into:
%WINDIR%\Microsoft.NET\Framework\v2.0.50727\

So, now let see how we can use Caspol.exe. Let say our application located on SRV-F01 server. SRV-F01 server has a shared folder Apps. Everybody on the network has drive I:\ mapped to the \\SRV-F01\Apps. So, the "magic" command in this case should looks like:
"% WINDIR %\Microsoft.NET\Framework\v2.0.50727\caspol" -q -machine -addgroup 1 -url file://I:/* FullTrust -name "I Drive"

That it. Now everybody (who executed a Caspol.exe as previously mentioned) can run the "problematic" application from drive I:\ or directly from \\SRV-F01\Apps.


Follow ITstuff.ca on Twitter

If you enjoyed this post consider subscribing via rssrectangle ITStuff.ca | Tips and Tricks for IT Staff or ITStuff.ca | Tips and Tricks for IT Staff Email


Bookmark and Share ITStuff.ca

2 comments:

  1. The ultimate answer must be... Thinapp!
    Google it yourself... :)

    ReplyDelete
  2. Mikmak2000, you are right, Thinapp can could be a solution in many situations (personally i prefer App-V (former SoftGrid)) but sometimes we have no choice and we have to use original application and we can't use Thinapp, App-v (Softhgrid), Portable apps or any other solution like those.

    ReplyDelete