I wrote a C # Windows Forms application for combining files and folders from a remote folder on one machine (the "source" folder is the mapped drive - "Z: \ folder") with another remote folder on the other machine (the "destination" folder is the way UNC to the shared folder is "\\ computer_name \ sharedfolder"). I have Full permissions for both folders. When I run the program on my local computer, it works fine, but when I try to run it from the source folder, it crashes with a security exception.
The crash occurs when the DirectoryInfo constructor is called for the target folder (for example, DirectoryInfo (@ "\\ computer_name \ sharedfolder). I assume that the problem is that I am running the program from the mapped drive. / P>
Specific exception: A permission request of type 'System.Security.Permissions.FileIOPermission, mscorlib, Version = 2.0.0.0, Culture = neutral, PublicKeyToken = b77a5c561934e089' failed.
UPDATE
Okay, I got my application in Visual Studio 2008 (it was previously encoded in 2005), aimed at the .NET 3.5 platform, compiled and retried.
I got the same error.
UPDATE - RESOLUTION
I tried this with .NET 3.5 and it did not work, then I noticed that you said 3.5 SP1. Service Pack required.
The problem is resolved. Thanks.
Rick
source share