I have a C # application that needs to specify a directory (Directory.GetFiles ()), as well as access one of the returned files. If I run the application locally, it has no problems accessing the network location or local locations, if I run it from a network share, then I get a security exception when accessing shared resources.
I found out why this is happening:
http://blogs.msdn.com/shawnfa/archive/2003/06/20/57023.aspx
However, the solutions seem ... impractical if I do not understand it.
1) I can’t use the code (hardly an option) 2) Sign the assemblies, and then for someone who is going to use it, configure the .NET policies to allow this? (It depends on the person who is going to use it to change one of their policies, which I am not talking about)? 3) Change the policy to allow full trust in everything on localintranet (not recommended or even possible in my case)
Something is missing for me, none of these options seems optimal for a stand-alone application that pops into a network in which I'm not talking. I would think that doing something is relatively simple, like launching an application from a network resource into a list of files in a directory would not require such crazy hoops so that they can work.
Anyone have thoughts on what I can do in this situation?