Just ran into an issue trying to run a simple .NET 2.0 file writing command-line app across a network share. No matter how much beating we couldn’t get it to run until we ran across this little batch file in the comments on the .NET Security Blog post, Using CasPol to Fully Trust a Share:
|
|
I dropped the code into a batch file called trustshare.bat
and ran it like this:
|
|
Suddenly the three hours of hair pulling finally ended. The batch file needs to be run on each machine that’s attempting to run the application, not on the machine that’s actually sharing the application.
While I really enjoy .NET for web applications I go crazy trying to use them as stand-alone desktop apps. I much prefer CodeGear’s Delphi when creating standard Win32 apps, you get a single EXE and don’t have to worry about a secondary layer of security permissions beyond the file system during deployment.