[.net] Security Exception Problem

Started by
1 comment, last by BradSnobar 17 years, 4 months ago
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
SynexCode Monkey
Advertisement
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.
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.

This topic is closed to new replies.

Advertisement