[quoted text, click to view] "Nicole Calinoiu" wrote:
> UnauthorizedAccessException usually indicates a problem with the user's NTFS
> permissions, not the code's CAS permissions. Are you sure the user account
> under which your code is running has adequate permissions to save the file
> to the target path? If so, might the problem be that you are attempting to
> overwrite a read-only file or a file that is in use by another process? If
> not, could you please provide the full exception details (as output by its
> ToString method)?
>
>
>
> "Caroline" <Caroline@community.nospam> wrote in message
> news:3B9CBEC8-D2B1-48CD-8276-41554CD8004E@microsoft.com...
> >I get "An unhandled exception of type 'System.UnauthorizedAccessException'
> > occurred in mscorlib.dll" when I try to download a csv file to my local
> > drive
> > from an ftp server. I've played around with the .NET Configuration tool
> > and
> > granted trust to mscorlib. I've granted FileIO write permissions and
> > Socket
> > Permissions in my ap. I've shared the folder. I'm new to the .Net
> > security
> > model, and I'm drowning in documentation. Could anyone point me in the
> > right
> > direction?
>
> Nicole,
I can download a file to the target path from the command prompt under the
user account. Here are the full exception details:
An unhandled exception of type 'System.Exception' occurred in
PrinzenWeights.exe
Additional information: System.UnauthorizedAccessException: Access to the
path "C:\Weights" is denied.
at System.IO.__Error.WinIOError(Int32 errorCode, String str)
at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess
access, FileShare share, Int32 bufferSize, Boolean useAsync, String msgPath,
Boolean bFromProxy)
Thank you,
Caroline