The backstory to this thread can be found here:
http://p2p.wrox.com/topic.asp?TOPIC_ID=60304
Essentially what I am trying to do is run a windows application off of a Thumbdrive over and RDP (Remote Desktop) session.
Since the thumbdrive is not recognized as a physical drive, the application on the thumbdrive does not get executed with Full Trust permissions. (Also, the code CANNOT be executed on the thin client where the Remote Desktop Session is being instantiated from)
So when the application is run all of my IO calls fail horribly since the code is running in partial trust. There are only 2 methods that I make calls to which are offending:
Application.StartupPath
and
System.Security.Principal.WindowsIdentity.GetCurre nt().Name.ToString()
I have only tried to deal with one thus far:
System.Security.Permissions.FileIOPermission p = new System.Security.Permissions.FileIOPermission(Syste m.Security.Permissions.FileIOPermissionAccess.AllA ccess, Application.StartupPath);
and then on a subsequent line i call
p.Demand();
Unfortunately, my code never reaches p.Demand() and I throw an I/O exception in the first tidbit of code.
The error is: Request Permission Failed. (I have also tried to lower the Access to Read which also generates the same error)
I have looked into add the application to a Full Trust zone via UNC but, unfortunately, I do not have the ability to add UNC paths to my thin clients!!
(Doing \\[thinclientname\ I am unable to see the thumbdrive so I am unable to add a UNC path)
So:
1) Am I requesting permissions incorrectly
2) If not, is there anyway around this problem?
Thanks in advance!
================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
================================================== =========
Technical Editor for:
Professional Search Engine Optimization with ASP.NET
http://www.wiley.com/WileyCDA/WileyT...470131470.html
================================================== =========
Why can't Programmers, program??
http://www.codinghorror.com/blog/archives/000781.html
================================================== =========