Sign in to follow this  
Synex

[.net] Security Exception Problem

Recommended Posts

Hey guys, I'm having a problem with .NET applications that i write for Windows. They compile and run ok on my machine, but when i try running them on any other machine, even those on my network - it throws a SecurityException because the code is not trusted. Anyone know how to get round this problem? Or some walkthroughs about .NET code security that would solve it? Cheers Synex

Share this post


Link to post
Share on other sites
Are you trying to run the code from a network share or pocket flash drive? By default, the .NET runtime will only allow code to run from the local hard drives.

Share this post


Link to post
Share on other sites
The post above is true for all practical purposes, but I just wanted to point out a distinction here. You can run .net code across the network (ie. from a share), but only if it does not try to do anything that needs security privelages.

The typical offender here is reading and writing a file.

Here are a few workarounds.

* You can change the caspool to help with this problem (give execute permission to that assembly). There is also a machine level configuration for this. You'll need to be using signed assemblies.

* You can create a client server relationship to help with this problem.

* Use a little bit of native code as a wrapper.

I'm sure that there is a better solution out there, but as yet I have not found it. If you find it, please post it.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this