This project has moved and is read-only. For the latest updates, please go here.

How to run library off a network share

Sep 22, 2008 at 7:41 PM
I'm trying to run a small program I wrote that enumerates the tasks.  It outputs the info to a text file so I it can be read by a vb script (not a great solution, I know, but I'm stuck with it for a variety of reasons).

So, when I run, I get a permissons failure because it's not fully trusted code (run's fine off the local d: drive though).

I tried added a [assembly: AllowPartiallyTrustedCallers] to the assemblyinfo.cs file.

Now I get 
Unhandled Exception: System.Security.SecurityException: System.Security.Permissi
   at TaskLister.TaskService..ctor(String targetServer, String userName, String accountDomain, String password)
   at TaskLister.TaskService..ctor(String targetServer)
   at TaskLister.TaskService..ctor()
   at TaskLister.Program.Main(String[] args)
The type of the first permission that failed was:
The demand was for:
<IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Ve
rsion=, Culture=neutral, PublicKeyToken=b77a5c561934e089"

which leads me to believe I need to put 
[SecurityPermission(SecurityAction.Assert, UnmanagedCode=true)]
in lots of places. Argh.

Am I missing something, or is there an easier way?


P.S. - I'm trying to run from a network share so my scripts are visible from multiple servers.  I realize I could just copy the exe/library to the local disk, but I'd like to avoid that.
Oct 15, 2008 at 12:44 AM
Try the release posted today. It may provide a fix, though I haven't tested it. Let me know.