469,945 Members | 1,809 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,945 developers. It's quick & easy.

System.Security.SecurityException thrown when running app from network drive.

Hello!

When I am trying to run my .NET application from a network drive a
System.Security.SecurityException exception is thrown. Why is that? How do I
prevent it?

Thanks!

/David.
Nov 15 '05 #1
2 6886
Hi David,

Programs run from network locations are executed with tighter security
restrictions than those run from local computer. I suggest that a program
run from a network falls into the "Local Intranet" code group which has
quite a limited set of permissions. As far as I know, there is no
programmatic way to overcome that. Instead, start the .NET Framework
Configuration tool and add more permissions for the corresponding code
group. You will obviously have to do so for each computer you expect to run
this program from a network on.

--
Dmitriy Lapshin [C# / .NET MVP]
X-Unity Test Studio
http://x-unity.miik.com.ua/teststudio.aspx
Bring the power of unit testing to VS .NET IDE

"David Lindgren" <da************@hogia.se.REMOVE!> wrote in message
news:eK**************@TK2MSFTNGP11.phx.gbl...
Hello!

When I am trying to run my .NET application from a network drive a
System.Security.SecurityException exception is thrown. Why is that? How do I prevent it?

Thanks!

/David.


Nov 15 '05 #2
The reason is because of the different security zones that .NET uses. For
instance, a programming running from another website has almost no local
privileges while those running from a local drive are god-like. When you
run from another share, you are running from an Intranet which has less
rights. Most likely you are receiving the error because you are trying to
do something that an Intranet application is not allowed to do be default.

To solve this you will need to change the .NET configuration for each
machine that this application will run from. You will need to run the .NET
Framework Configuration tool and adjust the Runtime Security Policy to give
you assembly more trust in your environment.

"David Lindgren" <da************@hogia.se.REMOVE!> wrote in message
news:eK**************@TK2MSFTNGP11.phx.gbl...
Hello!

When I am trying to run my .NET application from a network drive a
System.Security.SecurityException exception is thrown. Why is that? How do I prevent it?

Thanks!

/David.

Nov 15 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by Dave Cullen | last post: by
5 posts views Thread by Jarod_24 | last post: by
5 posts views Thread by Henry Stock | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.