none
Unable to start C# exe in a network folder RRS feed

  • Question

  • I have a C# executable (.NET Framework 3.5) put into a network folder, but when I run it, the programs gets errors or doesn't run at all. Is it because .NET doesn't like network folders, or is it something about trust levels or security?

    Thanks
    Evil and crazy
    Thursday, July 3, 2008 7:59 AM

Answers

  • it is because of .net framework security, only local drives are trusted to run code from, it has been like this since .net 1 but atleast they used to give you a control panel applet where you could trust certain exe's thus allowing them to run from network shares.  With 3.5, this applet is only installed with the .net sdk not the redist package which is a pain.

    You can alter .net framework security settings from the command prompt with caspol.exe but this will require that your assembly has been strong named.

    In short, don't do it.  Run all your exes from a c:\program files\company name folder.
    • Edited by ntsmith Thursday, July 3, 2008 8:48 AM spelling
    • Proposed as answer by Evil and Crazy Thursday, July 3, 2008 9:20 AM
    • Marked as answer by Evil and Crazy Thursday, July 3, 2008 9:20 AM
    Thursday, July 3, 2008 8:48 AM

All replies

  • it is because of .net framework security, only local drives are trusted to run code from, it has been like this since .net 1 but atleast they used to give you a control panel applet where you could trust certain exe's thus allowing them to run from network shares.  With 3.5, this applet is only installed with the .net sdk not the redist package which is a pain.

    You can alter .net framework security settings from the command prompt with caspol.exe but this will require that your assembly has been strong named.

    In short, don't do it.  Run all your exes from a c:\program files\company name folder.
    • Edited by ntsmith Thursday, July 3, 2008 8:48 AM spelling
    • Proposed as answer by Evil and Crazy Thursday, July 3, 2008 9:20 AM
    • Marked as answer by Evil and Crazy Thursday, July 3, 2008 9:20 AM
    Thursday, July 3, 2008 8:48 AM
  • Hi

    Thanks for reply
    me.Crazy = true; me.Evil = true; Combine(me.Crazy, me.Evil) = "DISASTER!";
    Thursday, July 3, 2008 9:20 AM