Reputation: 8003
I made a .exe program in c# and locally works fine... but if I put the .exe into a remote path, when I launch, it gives error.. I use framework 2.0 how can I solve this?
thanks
edit:
this is the error:
and if I launch the program locally, it works fine ( I copied all the folder with directories...)
Upvotes: 1
Views: 574
Reputation: 1064234
That is "code access security"; a random network share has very little trust from the core engine by default. With 2.0, your options are:
.application
, not the .exe
)caspol.exe
(on every client) to tell it to trust the shareWith some of the later service packs (it might be SP 2, I can't remember), mapped shares get more trust, i.e. \\server\share
won't have enough trust by default, but h:
(which is mapped to \\server\share
) will run.
My preference would be the ClickOnce deployment since it works on all versions.
Upvotes: 6
Reputation: 176269
If feasible, upgrade to .NET 3.5 SP1. This .NET Framework version will allow you to start executables off a network share:
.NET Framework 3.5 SP1 Allows managed code to be launched from a network share!
Upvotes: 2