I have code like the following to test for existence of a file. I know the
file is there, but File.Exists returns FALSE. The problem appears to be
that the file is in a directory beneath "My Documents". When I move it to a
directory directly under the root, File.Exists returns TRUE. So I tried
using FileIOPermission to give me rights to read it, but still no luck. Any
suggestions? Thanks...
FileIOPermission f = new
FileIOPermission(FileIOPermissionAccess.AllAccess, fileName);
if (!File.Exists(fileName))
throw new FileNotFoundException("Unable to construct
BinaryUploadFile object. File does not exist:\n\n" + fileName + "\n\n"); 18 3035
Dan,
If you don't have access to the directory, then Exists will return
false, as you expected.
You are creating the permission to see if you can access the directory,
to prevent a false negative. However, you aren't doing anything to indicate
whether or not you have permission. Between the call to Exists, and the
construction of the permission, call Demand on the permission. It will
throw a SecurityException if you don't have access to the directory.
Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com
"Dan" <da*@dontspamme.com> wrote in message
news:Os**************@TK2MSFTNGP15.phx.gbl... I have code like the following to test for existence of a file. I know the file is there, but File.Exists returns FALSE. The problem appears to be that the file is in a directory beneath "My Documents". When I move it to a directory directly under the root, File.Exists returns TRUE. So I tried using FileIOPermission to give me rights to read it, but still no luck. Any suggestions? Thanks...
FileIOPermission f = new FileIOPermission(FileIOPermissionAccess.AllAccess, fileName); if (!File.Exists(fileName)) throw new FileNotFoundException("Unable to construct BinaryUploadFile object. File does not exist:\n\n" + fileName + "\n\n");
Dan,
If you don't have access to the directory, then Exists will return
false, as you expected.
You are creating the permission to see if you can access the directory,
to prevent a false negative. However, you aren't doing anything to indicate
whether or not you have permission. Between the call to Exists, and the
construction of the permission, call Demand on the permission. It will
throw a SecurityException if you don't have access to the directory.
Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com
"Dan" <da*@dontspamme.com> wrote in message
news:Os**************@TK2MSFTNGP15.phx.gbl... I have code like the following to test for existence of a file. I know the file is there, but File.Exists returns FALSE. The problem appears to be that the file is in a directory beneath "My Documents". When I move it to a directory directly under the root, File.Exists returns TRUE. So I tried using FileIOPermission to give me rights to read it, but still no luck. Any suggestions? Thanks...
FileIOPermission f = new FileIOPermission(FileIOPermissionAccess.AllAccess, fileName); if (!File.Exists(fileName)) throw new FileNotFoundException("Unable to construct BinaryUploadFile object. File does not exist:\n\n" + fileName + "\n\n");
If you (the windows identity running the code) don't have the right
permissions to the folder holding the file, File.Exists will return false,
as you are experiencing.
This is called "windows access security " based on the identity of the
caller.
You are confusing this security mechanism with .NET's "Code access security"
, this kind of security mechanism is based on the "code identity" (where did
the code came from - internet, intranet, codegroup , ...) NOT the windows
user identity, these are fundamentally different. Whatever you do in code
(that is Code Access Security) won't help if the "windows user" has no
access rights for the objects (like files) controlled by the OS security
system (Windows security).
In short you need to fix the NTFS security settings on the file/folder.
Willy.
"Dan" <da*@dontspamme.com> wrote in message
news:Os**************@TK2MSFTNGP15.phx.gbl... I have code like the following to test for existence of a file. I know the file is there, but File.Exists returns FALSE. The problem appears to be that the file is in a directory beneath "My Documents". When I move it to a directory directly under the root, File.Exists returns TRUE. So I tried using FileIOPermission to give me rights to read it, but still no luck. Any suggestions? Thanks...
FileIOPermission f = new FileIOPermission(FileIOPermissionAccess.AllAccess, fileName); if (!File.Exists(fileName)) throw new FileNotFoundException("Unable to construct BinaryUploadFile object. File does not exist:\n\n" + fileName + "\n\n");
If you (the windows identity running the code) don't have the right
permissions to the folder holding the file, File.Exists will return false,
as you are experiencing.
This is called "windows access security " based on the identity of the
caller.
You are confusing this security mechanism with .NET's "Code access security"
, this kind of security mechanism is based on the "code identity" (where did
the code came from - internet, intranet, codegroup , ...) NOT the windows
user identity, these are fundamentally different. Whatever you do in code
(that is Code Access Security) won't help if the "windows user" has no
access rights for the objects (like files) controlled by the OS security
system (Windows security).
In short you need to fix the NTFS security settings on the file/folder.
Willy.
"Dan" <da*@dontspamme.com> wrote in message
news:Os**************@TK2MSFTNGP15.phx.gbl... I have code like the following to test for existence of a file. I know the file is there, but File.Exists returns FALSE. The problem appears to be that the file is in a directory beneath "My Documents". When I move it to a directory directly under the root, File.Exists returns TRUE. So I tried using FileIOPermission to give me rights to read it, but still no luck. Any suggestions? Thanks...
FileIOPermission f = new FileIOPermission(FileIOPermissionAccess.AllAccess, fileName); if (!File.Exists(fileName)) throw new FileNotFoundException("Unable to construct BinaryUploadFile object. File does not exist:\n\n" + fileName + "\n\n");
Thanks Nick, but it didn't seem to work. Changed the code to this (see
below), but Exists still returned false. Any more ideas?
FileIOPermission f = new
FileIOPermission(FileIOPermissionAccess.AllAccess, fileName);
f.Demand();
if (!File.Exists(fileName))
throw new FileNotFoundException("Unable to construct
BinaryUploadFile object. File does not exist:\n\n" + fileName + "\n\n");
"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.com> wrote in
message news:%2****************@TK2MSFTNGP09.phx.gbl... Dan,
If you don't have access to the directory, then Exists will return false, as you expected.
You are creating the permission to see if you can access the
directory, to prevent a false negative. However, you aren't doing anything to
indicate whether or not you have permission. Between the call to Exists, and the construction of the permission, call Demand on the permission. It will throw a SecurityException if you don't have access to the directory.
Hope this helps.
-- - Nicholas Paldino [.NET/C# MVP] - mv*@spam.guard.caspershouse.com
"Dan" <da*@dontspamme.com> wrote in message news:Os**************@TK2MSFTNGP15.phx.gbl...I have code like the following to test for existence of a file. I know
the file is there, but File.Exists returns FALSE. The problem appears to be that the file is in a directory beneath "My Documents". When I move it
to a directory directly under the root, File.Exists returns TRUE. So I tried using FileIOPermission to give me rights to read it, but still no luck. Any suggestions? Thanks...
FileIOPermission f = new FileIOPermission(FileIOPermissionAccess.AllAccess, fileName); if (!File.Exists(fileName)) throw new FileNotFoundException("Unable to construct BinaryUploadFile object. File does not exist:\n\n" + fileName + "\n\n");
Thanks Nick, but it didn't seem to work. Changed the code to this (see
below), but Exists still returned false. Any more ideas?
FileIOPermission f = new
FileIOPermission(FileIOPermissionAccess.AllAccess, fileName);
f.Demand();
if (!File.Exists(fileName))
throw new FileNotFoundException("Unable to construct
BinaryUploadFile object. File does not exist:\n\n" + fileName + "\n\n");
"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.com> wrote in
message news:%2****************@TK2MSFTNGP09.phx.gbl... Dan,
If you don't have access to the directory, then Exists will return false, as you expected.
You are creating the permission to see if you can access the
directory, to prevent a false negative. However, you aren't doing anything to
indicate whether or not you have permission. Between the call to Exists, and the construction of the permission, call Demand on the permission. It will throw a SecurityException if you don't have access to the directory.
Hope this helps.
-- - Nicholas Paldino [.NET/C# MVP] - mv*@spam.guard.caspershouse.com
"Dan" <da*@dontspamme.com> wrote in message news:Os**************@TK2MSFTNGP15.phx.gbl...I have code like the following to test for existence of a file. I know
the file is there, but File.Exists returns FALSE. The problem appears to be that the file is in a directory beneath "My Documents". When I move it
to a directory directly under the root, File.Exists returns TRUE. So I tried using FileIOPermission to give me rights to read it, but still no luck. Any suggestions? Thanks...
FileIOPermission f = new FileIOPermission(FileIOPermissionAccess.AllAccess, fileName); if (!File.Exists(fileName)) throw new FileNotFoundException("Unable to construct BinaryUploadFile object. File does not exist:\n\n" + fileName + "\n\n");
But I'm running with administrative rights, with full access to the files in
that directory. Could it have something to do with running from the
debugger?
"Willy Denoyette [MVP]" <wi*************@pandora.be> wrote in message
news:OW**************@TK2MSFTNGP14.phx.gbl... If you (the windows identity running the code) don't have the right permissions to the folder holding the file, File.Exists will return false, as you are experiencing. This is called "windows access security " based on the identity of the caller. You are confusing this security mechanism with .NET's "Code access
security" , this kind of security mechanism is based on the "code identity" (where
did the code came from - internet, intranet, codegroup , ...) NOT the windows user identity, these are fundamentally different. Whatever you do in code (that is Code Access Security) won't help if the "windows user" has no access rights for the objects (like files) controlled by the OS security system (Windows security).
In short you need to fix the NTFS security settings on the file/folder.
Willy. "Dan" <da*@dontspamme.com> wrote in message news:Os**************@TK2MSFTNGP15.phx.gbl...I have code like the following to test for existence of a file. I know
the file is there, but File.Exists returns FALSE. The problem appears to be that the file is in a directory beneath "My Documents". When I move it
to a directory directly under the root, File.Exists returns TRUE. So I tried using FileIOPermission to give me rights to read it, but still no luck. Any suggestions? Thanks...
FileIOPermission f = new FileIOPermission(FileIOPermissionAccess.AllAccess, fileName); if (!File.Exists(fileName)) throw new FileNotFoundException("Unable to construct BinaryUploadFile object. File does not exist:\n\n" + fileName + "\n\n");
But I'm running with administrative rights, with full access to the files in
that directory. Could it have something to do with running from the
debugger?
"Willy Denoyette [MVP]" <wi*************@pandora.be> wrote in message
news:OW**************@TK2MSFTNGP14.phx.gbl... If you (the windows identity running the code) don't have the right permissions to the folder holding the file, File.Exists will return false, as you are experiencing. This is called "windows access security " based on the identity of the caller. You are confusing this security mechanism with .NET's "Code access
security" , this kind of security mechanism is based on the "code identity" (where
did the code came from - internet, intranet, codegroup , ...) NOT the windows user identity, these are fundamentally different. Whatever you do in code (that is Code Access Security) won't help if the "windows user" has no access rights for the objects (like files) controlled by the OS security system (Windows security).
In short you need to fix the NTFS security settings on the file/folder.
Willy. "Dan" <da*@dontspamme.com> wrote in message news:Os**************@TK2MSFTNGP15.phx.gbl...I have code like the following to test for existence of a file. I know
the file is there, but File.Exists returns FALSE. The problem appears to be that the file is in a directory beneath "My Documents". When I move it
to a directory directly under the root, File.Exists returns TRUE. So I tried using FileIOPermission to give me rights to read it, but still no luck. Any suggestions? Thanks...
FileIOPermission f = new FileIOPermission(FileIOPermissionAccess.AllAccess, fileName); if (!File.Exists(fileName)) throw new FileNotFoundException("Unable to construct BinaryUploadFile object. File does not exist:\n\n" + fileName + "\n\n");
Dan,
Just a question, what is the value being passed in for fileName, and the
actual path to the filename you are trying to find?
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com
"Dan" <da*@dontspamme.com> wrote in message
news:uh**************@TK2MSFTNGP09.phx.gbl... Thanks Nick, but it didn't seem to work. Changed the code to this (see below), but Exists still returned false. Any more ideas?
FileIOPermission f = new FileIOPermission(FileIOPermissionAccess.AllAccess, fileName); f.Demand(); if (!File.Exists(fileName)) throw new FileNotFoundException("Unable to construct BinaryUploadFile object. File does not exist:\n\n" + fileName + "\n\n");
"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.com> wrote in message news:%2****************@TK2MSFTNGP09.phx.gbl... Dan,
If you don't have access to the directory, then Exists will return false, as you expected.
You are creating the permission to see if you can access the directory, to prevent a false negative. However, you aren't doing anything to indicate whether or not you have permission. Between the call to Exists, and the construction of the permission, call Demand on the permission. It will throw a SecurityException if you don't have access to the directory.
Hope this helps.
-- - Nicholas Paldino [.NET/C# MVP] - mv*@spam.guard.caspershouse.com
"Dan" <da*@dontspamme.com> wrote in message news:Os**************@TK2MSFTNGP15.phx.gbl... >I have code like the following to test for existence of a file. I know the > file is there, but File.Exists returns FALSE. The problem appears to > be > that the file is in a directory beneath "My Documents". When I move it to > a > directory directly under the root, File.Exists returns TRUE. So I > tried > using FileIOPermission to give me rights to read it, but still no luck. > Any > suggestions? Thanks... > > FileIOPermission f = new > FileIOPermission(FileIOPermissionAccess.AllAccess, fileName); > if (!File.Exists(fileName)) > throw new FileNotFoundException("Unable to construct > BinaryUploadFile object. File does not exist:\n\n" + fileName + > "\n\n"); > >
Dan,
Just a question, what is the value being passed in for fileName, and the
actual path to the filename you are trying to find?
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com
"Dan" <da*@dontspamme.com> wrote in message
news:uh**************@TK2MSFTNGP09.phx.gbl... Thanks Nick, but it didn't seem to work. Changed the code to this (see below), but Exists still returned false. Any more ideas?
FileIOPermission f = new FileIOPermission(FileIOPermissionAccess.AllAccess, fileName); f.Demand(); if (!File.Exists(fileName)) throw new FileNotFoundException("Unable to construct BinaryUploadFile object. File does not exist:\n\n" + fileName + "\n\n");
"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.com> wrote in message news:%2****************@TK2MSFTNGP09.phx.gbl... Dan,
If you don't have access to the directory, then Exists will return false, as you expected.
You are creating the permission to see if you can access the directory, to prevent a false negative. However, you aren't doing anything to indicate whether or not you have permission. Between the call to Exists, and the construction of the permission, call Demand on the permission. It will throw a SecurityException if you don't have access to the directory.
Hope this helps.
-- - Nicholas Paldino [.NET/C# MVP] - mv*@spam.guard.caspershouse.com
"Dan" <da*@dontspamme.com> wrote in message news:Os**************@TK2MSFTNGP15.phx.gbl... >I have code like the following to test for existence of a file. I know the > file is there, but File.Exists returns FALSE. The problem appears to > be > that the file is in a directory beneath "My Documents". When I move it to > a > directory directly under the root, File.Exists returns TRUE. So I > tried > using FileIOPermission to give me rights to read it, but still no luck. > Any > suggestions? Thanks... > > FileIOPermission f = new > FileIOPermission(FileIOPermissionAccess.AllAccess, fileName); > if (!File.Exists(fileName)) > throw new FileNotFoundException("Unable to construct > BinaryUploadFile object. File does not exist:\n\n" + fileName + > "\n\n"); > >
Dan,
It could be that you simply don't have the NTFS permissions (which the
permissions class is not going to pick up), and File.Exists is going to
return false. The Exists method actuall uses the FindFirstFile API function
to determine if the file exists, and I imagine that if the user account the
app is running under doesn't have rights to that directory, then it will
return false to see if it exists.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com
"Dan" <da*@dontspamme.com> wrote in message
news:uh**************@TK2MSFTNGP09.phx.gbl... Thanks Nick, but it didn't seem to work. Changed the code to this (see below), but Exists still returned false. Any more ideas?
FileIOPermission f = new FileIOPermission(FileIOPermissionAccess.AllAccess, fileName); f.Demand(); if (!File.Exists(fileName)) throw new FileNotFoundException("Unable to construct BinaryUploadFile object. File does not exist:\n\n" + fileName + "\n\n");
"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.com> wrote in message news:%2****************@TK2MSFTNGP09.phx.gbl... Dan,
If you don't have access to the directory, then Exists will return false, as you expected.
You are creating the permission to see if you can access the directory, to prevent a false negative. However, you aren't doing anything to indicate whether or not you have permission. Between the call to Exists, and the construction of the permission, call Demand on the permission. It will throw a SecurityException if you don't have access to the directory.
Hope this helps.
-- - Nicholas Paldino [.NET/C# MVP] - mv*@spam.guard.caspershouse.com
"Dan" <da*@dontspamme.com> wrote in message news:Os**************@TK2MSFTNGP15.phx.gbl... >I have code like the following to test for existence of a file. I know the > file is there, but File.Exists returns FALSE. The problem appears to > be > that the file is in a directory beneath "My Documents". When I move it to > a > directory directly under the root, File.Exists returns TRUE. So I > tried > using FileIOPermission to give me rights to read it, but still no luck. > Any > suggestions? Thanks... > > FileIOPermission f = new > FileIOPermission(FileIOPermissionAccess.AllAccess, fileName); > if (!File.Exists(fileName)) > throw new FileNotFoundException("Unable to construct > BinaryUploadFile object. File does not exist:\n\n" + fileName + > "\n\n"); > >
Dan,
It could be that you simply don't have the NTFS permissions (which the
permissions class is not going to pick up), and File.Exists is going to
return false. The Exists method actuall uses the FindFirstFile API function
to determine if the file exists, and I imagine that if the user account the
app is running under doesn't have rights to that directory, then it will
return false to see if it exists.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com
"Dan" <da*@dontspamme.com> wrote in message
news:uh**************@TK2MSFTNGP09.phx.gbl... Thanks Nick, but it didn't seem to work. Changed the code to this (see below), but Exists still returned false. Any more ideas?
FileIOPermission f = new FileIOPermission(FileIOPermissionAccess.AllAccess, fileName); f.Demand(); if (!File.Exists(fileName)) throw new FileNotFoundException("Unable to construct BinaryUploadFile object. File does not exist:\n\n" + fileName + "\n\n");
"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.com> wrote in message news:%2****************@TK2MSFTNGP09.phx.gbl... Dan,
If you don't have access to the directory, then Exists will return false, as you expected.
You are creating the permission to see if you can access the directory, to prevent a false negative. However, you aren't doing anything to indicate whether or not you have permission. Between the call to Exists, and the construction of the permission, call Demand on the permission. It will throw a SecurityException if you don't have access to the directory.
Hope this helps.
-- - Nicholas Paldino [.NET/C# MVP] - mv*@spam.guard.caspershouse.com
"Dan" <da*@dontspamme.com> wrote in message news:Os**************@TK2MSFTNGP15.phx.gbl... >I have code like the following to test for existence of a file. I know the > file is there, but File.Exists returns FALSE. The problem appears to > be > that the file is in a directory beneath "My Documents". When I move it to > a > directory directly under the root, File.Exists returns TRUE. So I > tried > using FileIOPermission to give me rights to read it, but still no luck. > Any > suggestions? Thanks... > > FileIOPermission f = new > FileIOPermission(FileIOPermissionAccess.AllAccess, fileName); > if (!File.Exists(fileName)) > throw new FileNotFoundException("Unable to construct > BinaryUploadFile object. File does not exist:\n\n" + fileName + > "\n\n"); > >
Are you completely sure the file name is correct?
--
Regards,
Dennis JD Myrén
Oslo Kodebureau
"Dan" <da*@dontspamme.com> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl... But I'm running with administrative rights, with full access to the files
in that directory. Could it have something to do with running from the debugger?
"Willy Denoyette [MVP]" <wi*************@pandora.be> wrote in message news:OW**************@TK2MSFTNGP14.phx.gbl... If you (the windows identity running the code) don't have the right permissions to the folder holding the file, File.Exists will return
false, as you are experiencing. This is called "windows access security " based on the identity of the caller. You are confusing this security mechanism with .NET's "Code access security" , this kind of security mechanism is based on the "code identity" (where did the code came from - internet, intranet, codegroup , ...) NOT the
windows user identity, these are fundamentally different. Whatever you do in
code (that is Code Access Security) won't help if the "windows user" has no access rights for the objects (like files) controlled by the OS security system (Windows security).
In short you need to fix the NTFS security settings on the file/folder.
Willy. "Dan" <da*@dontspamme.com> wrote in message news:Os**************@TK2MSFTNGP15.phx.gbl...I have code like the following to test for existence of a file. I know the file is there, but File.Exists returns FALSE. The problem appears to
be that the file is in a directory beneath "My Documents". When I move
it to a directory directly under the root, File.Exists returns TRUE. So I
tried using FileIOPermission to give me rights to read it, but still no
luck. Any suggestions? Thanks...
FileIOPermission f = new FileIOPermission(FileIOPermissionAccess.AllAccess, fileName); if (!File.Exists(fileName)) throw new FileNotFoundException("Unable to construct BinaryUploadFile object. File does not exist:\n\n" + fileName +
"\n\n");
Are you completely sure the file name is correct?
--
Regards,
Dennis JD Myrén
Oslo Kodebureau
"Dan" <da*@dontspamme.com> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl... But I'm running with administrative rights, with full access to the files
in that directory. Could it have something to do with running from the debugger?
"Willy Denoyette [MVP]" <wi*************@pandora.be> wrote in message news:OW**************@TK2MSFTNGP14.phx.gbl... If you (the windows identity running the code) don't have the right permissions to the folder holding the file, File.Exists will return
false, as you are experiencing. This is called "windows access security " based on the identity of the caller. You are confusing this security mechanism with .NET's "Code access security" , this kind of security mechanism is based on the "code identity" (where did the code came from - internet, intranet, codegroup , ...) NOT the
windows user identity, these are fundamentally different. Whatever you do in
code (that is Code Access Security) won't help if the "windows user" has no access rights for the objects (like files) controlled by the OS security system (Windows security).
In short you need to fix the NTFS security settings on the file/folder.
Willy. "Dan" <da*@dontspamme.com> wrote in message news:Os**************@TK2MSFTNGP15.phx.gbl...I have code like the following to test for existence of a file. I know the file is there, but File.Exists returns FALSE. The problem appears to
be that the file is in a directory beneath "My Documents". When I move
it to a directory directly under the root, File.Exists returns TRUE. So I
tried using FileIOPermission to give me rights to read it, but still no
luck. Any suggestions? Thanks...
FileIOPermission f = new FileIOPermission(FileIOPermissionAccess.AllAccess, fileName); if (!File.Exists(fileName)) throw new FileNotFoundException("Unable to construct BinaryUploadFile object. File does not exist:\n\n" + fileName +
"\n\n");
Ok, make sure the file path is correct and/or check if the administrators
group has access to the folder.
Willy.
"Dan" <da*@dontspamme.com> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl... But I'm running with administrative rights, with full access to the files in that directory. Could it have something to do with running from the debugger?
Ok, make sure the file path is correct and/or check if the administrators
group has access to the folder.
Willy.
"Dan" <da*@dontspamme.com> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl... But I'm running with administrative rights, with full access to the files in that directory. Could it have something to do with running from the debugger?
Sorry to waste your time. I was pulling the filename out some XML which was
generated on another machine; thus the "My Documents" paths were different.
While I'm at it, is an assembly directive like the one below the best way to
ensure you have file access rights on an assembly-wide basis:
[assembly:PermissionSetAttribute(SecurityAction.Req uestMinimum, Name =
"FullTrust")]
"Willy Denoyette [MVP]" <wi*************@pandora.be> wrote in message
news:u7**************@TK2MSFTNGP11.phx.gbl... Ok, make sure the file path is correct and/or check if the administrators group has access to the folder.
Willy.
"Dan" <da*@dontspamme.com> wrote in message news:%2****************@TK2MSFTNGP09.phx.gbl... But I'm running with administrative rights, with full access to the
files in that directory. Could it have something to do with running from the debugger?
Sorry to waste your time. I was pulling the filename out some XML which was
generated on another machine; thus the "My Documents" paths were different.
While I'm at it, is an assembly directive like the one below the best way to
ensure you have file access rights on an assembly-wide basis:
[assembly:PermissionSetAttribute(SecurityAction.Req uestMinimum, Name =
"FullTrust")]
"Willy Denoyette [MVP]" <wi*************@pandora.be> wrote in message
news:u7**************@TK2MSFTNGP11.phx.gbl... Ok, make sure the file path is correct and/or check if the administrators group has access to the folder.
Willy.
"Dan" <da*@dontspamme.com> wrote in message news:%2****************@TK2MSFTNGP09.phx.gbl... But I'm running with administrative rights, with full access to the
files in that directory. Could it have something to do with running from the debugger?
This discussion thread is closed Replies have been disabled for this discussion. Similar topics
10 posts
views
Thread by Raymond |
last post: by
|
2 posts
views
Thread by Chris Fink |
last post: by
|
4 posts
views
Thread by Matt Jensen |
last post: by
|
3 posts
views
Thread by Lou |
last post: by
|
1 post
views
Thread by Tim Failes |
last post: by
|
52 posts
views
Thread by paytam |
last post: by
|
17 posts
views
Thread by Peter Duniho |
last post: by
|
7 posts
views
Thread by sprash |
last post: by
|
8 posts
views
Thread by Sweetiecakes |
last post: by
| | | | | | | | | | |