Monday, March 26, 2012

Please help - weird problem

Hi,
While trying to create new directory i recieve the following error
message:
"System.IO.DirectoryNotFoundException: Could not find a part of the path
"\\premfs16\sites".
The path exists, even when i check the path
with the code: Directory.Exists(...) the result is true.

Here is the code:
http://www.adeo.co.il/test.aspx

Notice that in the line before the code throws exception
i create new file to the same path and no error
occurs - only when trying to create directory
the error appears.

Any idea?Yoni,

This is a security problem. You need to grant read permission for
\\premfs16\sites to the ASP.NET user.

Eliyahu

"?? ???" <@.discussions.microsoft.com> wrote in message
news:B997041C-220A-4ADC-9528-65BC289CED2F@.microsoft.com...
> Hi,
> While trying to create new directory i recieve the following error
> message:
> "System.IO.DirectoryNotFoundException: Could not find a part of the path
> "\\premfs16\sites".
> The path exists, even when i check the path
> with the code: Directory.Exists(...) the result is true.
> Here is the code:
> http://www.adeo.co.il/test.aspx
> Notice that in the line before the code throws exception
> i create new file to the same path and no error
> occurs - only when trying to create directory
> the error appears.
> Any idea?
So how do you explain that the code succeeded creating
a file (which needs to read the same path...) and only
creating a directory failed?

"Eliyahu Goldin" wrote:

> Yoni,
> This is a security problem. You need to grant read permission for
> \\premfs16\sites to the ASP.NET user.
> Eliyahu
> "?? ???" <@.discussions.microsoft.com> wrote in message
> news:B997041C-220A-4ADC-9528-65BC289CED2F@.microsoft.com...
> > Hi,
> > While trying to create new directory i recieve the following error
> > message:
> > "System.IO.DirectoryNotFoundException: Could not find a part of the path
> > "\\premfs16\sites".
> > The path exists, even when i check the path
> > with the code: Directory.Exists(...) the result is true.
> > Here is the code:
> > http://www.adeo.co.il/test.aspx
> > Notice that in the line before the code throws exception
> > i create new file to the same path and no error
> > occurs - only when trying to create directory
> > the error appears.
> > Any idea?
>
Yoni,

Probably file creating doesn't require read permission but directory
creating does. I don't know exactly how all these permissions work.

Security and permission setting is a complicated matter. You don't really
need to understand fully the theoretical background. For your immediate
problem it's enough to know how other people solved the same problem. If you
wish to investigate - you are welcome to invest your time in that.

Eliyahu

"?? ???" <@.discussions.microsoft.com> wrote in message
news:6EA67417-C3C4-4B5E-9084-DDC2EBB3DC76@.microsoft.com...
> So how do you explain that the code succeeded creating
> a file (which needs to read the same path...) and only
> creating a directory failed?
> "Eliyahu Goldin" wrote:
> > Yoni,
> > This is a security problem. You need to grant read permission for
> > \\premfs16\sites to the ASP.NET user.
> > Eliyahu
> > "?? ???" <@.discussions.microsoft.com> wrote in message
> > news:B997041C-220A-4ADC-9528-65BC289CED2F@.microsoft.com...
> > > Hi,
> > > While trying to create new directory i recieve the following error
> > > message:
> > > "System.IO.DirectoryNotFoundException: Could not find a part of the
path
> > > "\\premfs16\sites".
> > > The path exists, even when i check the path
> > > with the code: Directory.Exists(...) the result is true.
> > > > Here is the code:
> > > http://www.adeo.co.il/test.aspx
> > > > Notice that in the line before the code throws exception
> > > i create new file to the same path and no error
> > > occurs - only when trying to create directory
> > > the error appears.
> > > > Any idea?
>
The problem is much more sophisticated.
My web site host at shared hosting company.
No hosting company will allow users to have read
permissions on their root directory.
So what you are actually saying is that you can not
open directories on web sites which hosts on shared servers.
Is that correct?

"Eliyahu Goldin" wrote:

> Yoni,
> Probably file creating doesn't require read permission but directory
> creating does. I don't know exactly how all these permissions work.
> Security and permission setting is a complicated matter. You don't really
> need to understand fully the theoretical background. For your immediate
> problem it's enough to know how other people solved the same problem. If you
> wish to investigate - you are welcome to invest your time in that.
> Eliyahu
> "?? ???" <@.discussions.microsoft.com> wrote in message
> news:6EA67417-C3C4-4B5E-9084-DDC2EBB3DC76@.microsoft.com...
> > So how do you explain that the code succeeded creating
> > a file (which needs to read the same path...) and only
> > creating a directory failed?
> > "Eliyahu Goldin" wrote:
> > > Yoni,
> > > > This is a security problem. You need to grant read permission for
> > > \\premfs16\sites to the ASP.NET user.
> > > > Eliyahu
> > > > "?? ???" <@.discussions.microsoft.com> wrote in message
> > > news:B997041C-220A-4ADC-9528-65BC289CED2F@.microsoft.com...
> > > > Hi,
> > > > While trying to create new directory i recieve the following error
> > > > message:
> > > > "System.IO.DirectoryNotFoundException: Could not find a part of the
> path
> > > > "\\premfs16\sites".
> > > > The path exists, even when i check the path
> > > > with the code: Directory.Exists(...) the result is true.
> > > > > > Here is the code:
> > > > http://www.adeo.co.il/test.aspx
> > > > > > Notice that in the line before the code throws exception
> > > > i create new file to the same path and no error
> > > > occurs - only when trying to create directory
> > > > the error appears.
> > > > > > Any idea?
> > > > > >
Well, I don't think you need read permissions for the root directory, only
for those under yours. Speak to your host and ask again on security
newsgroups.

Good luck,

Eliyahu

"?? ???" <@.discussions.microsoft.com> wrote in message
news:064E4D9D-5536-4DFD-A83D-6B9957ED5BFE@.microsoft.com...
> The problem is much more sophisticated.
> My web site host at shared hosting company.
> No hosting company will allow users to have read
> permissions on their root directory.
> So what you are actually saying is that you can not
> open directories on web sites which hosts on shared servers.
> Is that correct?
> "Eliyahu Goldin" wrote:
> > Yoni,
> > Probably file creating doesn't require read permission but directory
> > creating does. I don't know exactly how all these permissions work.
> > Security and permission setting is a complicated matter. You don't
really
> > need to understand fully the theoretical background. For your immediate
> > problem it's enough to know how other people solved the same problem. If
you
> > wish to investigate - you are welcome to invest your time in that.
> > Eliyahu
> > "?? ???" <@.discussions.microsoft.com> wrote in message
> > news:6EA67417-C3C4-4B5E-9084-DDC2EBB3DC76@.microsoft.com...
> > > So how do you explain that the code succeeded creating
> > > a file (which needs to read the same path...) and only
> > > creating a directory failed?
> > > > "Eliyahu Goldin" wrote:
> > > > > Yoni,
> > > > > > This is a security problem. You need to grant read permission for
> > > > \\premfs16\sites to the ASP.NET user.
> > > > > > Eliyahu
> > > > > > "?? ???" <@.discussions.microsoft.com> wrote in message
> > > > news:B997041C-220A-4ADC-9528-65BC289CED2F@.microsoft.com...
> > > > > Hi,
> > > > > While trying to create new directory i recieve the following error
> > > > > message:
> > > > > "System.IO.DirectoryNotFoundException: Could not find a part of
the
> > path
> > > > > "\\premfs16\sites".
> > > > > The path exists, even when i check the path
> > > > > with the code: Directory.Exists(...) the result is true.
> > > > > > > > Here is the code:
> > > > > http://www.adeo.co.il/test.aspx
> > > > > > > > Notice that in the line before the code throws exception
> > > > > i create new file to the same path and no error
> > > > > occurs - only when trying to create directory
> > > > > the error appears.
> > > > > > > > Any idea?
> > > > > > > > >

0 comments:

Post a Comment