Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Running a C# exe file

Tags:

c#

.net

Duplicate:

Why does my .NET application crash when run from a network drive?


Can someone help me? For a school project, I wrote a C# windows application in Visual Studio 2005. It works just fine, no problems. I want to be able to share this program with others in my department at work. So, I copied the exe file to a network drive. When we attempt to run the exe from the network, it fails with "name of progrm...has encountered a problem and needs to close". If I have the co-worker copy the exe file to their c:\ drive then attempt to run, it works. Why won't my program run from the network drive?

Susan


2 Answers

.NET by default does not allow applications to be run off a network drive. Either copy it to a local drive or alter the security settings for .NET.

This discussion should give you what you need.

like image 77
Fredrik Mörk Avatar answered Dec 15 '25 08:12

Fredrik Mörk


Microsoft has finally realised that the default behavior of preventing applications from running off a network drive is wrong. From The .NET 3.5 SP1 download page:

"Additionally, managed applications that are opened from network shares have the same behavior as native applications by running with full trust."

This change is long overdue: there is virtually no security benefit in preventing managed applications running from a network share, since a hacker could just as easily use an unmanaged application.

like image 33
Joe Avatar answered Dec 15 '25 09:12

Joe



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!