473,513 Members | 2,624 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

ASP Error : Could not find a part of the path

Hi everybody,

First of all, sorry for my english if it isn't perfect ;-p

I have an error in an asp.net application.

I have win2003 server, with iis 6. I'm developping with visual studio
2005, vb.net, framework 2

I'm trying to access some binary files stored in C: in server2003. if i
access them with C:\... it's fine. Now to access them quickly I work
with a Ramdisk (Y:) and it works fine if i access with Y:\....

If I make a shared folder and try to access them with
\\srv2003\sharedfolder\... it works fine too. But now I'm trying to
access them with a Network Drive Map (Z:) and I get this error :

System.IO.DirectoryNotFoundException: Could not find a part of the path
'Z:\filename.ext'.
at System.IO.__Error.WinIOError(Int32 errorCode, String
maybeFullPath)
at System.IO.FileStream.Init(String path, FileMode mode, FileAccess
access, Int32 rights, Boolean useRights, FileShare share, Int32
bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String
msgPath, Boolean bFromProxy)
at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess
access, FileShare share)
at Service.GetPersonObject(Int32 IdPerso) in
C:\Inetpub\wwwroot\WebServicePerson\WebServicePers on\App_Code\Service.vb:line
1152

I've seen many topics here where it says to give rights to Asp user.
I've made it. Somebody says to make impersonate application and I have
made it too

<identity impersonate="true" userName="user" password="pwd"/>

But i'm still having this problem. Could someone help me?

In fact i'm trying to access these files through a map drive to test
access with webservices throug the network layer. If we make it only
with a shared folder, does windows use the same implementation of
network layer?

I'm waiting some help impatiently ;-)

Gianfranco

Nov 19 '05 #1
14 9353
With windows Server 2003, you need to give access to Network Service. Be wary
of opening up security too much.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

***************************
Think Outside the Box!
***************************
"Gianfranco" wrote:
Hi everybody,

First of all, sorry for my english if it isn't perfect ;-p

I have an error in an asp.net application.

I have win2003 server, with iis 6. I'm developping with visual studio
2005, vb.net, framework 2

I'm trying to access some binary files stored in C: in server2003. if i
access them with C:\... it's fine. Now to access them quickly I work
with a Ramdisk (Y:) and it works fine if i access with Y:\....

If I make a shared folder and try to access them with
\\srv2003\sharedfolder\... it works fine too. But now I'm trying to
access them with a Network Drive Map (Z:) and I get this error :

System.IO.DirectoryNotFoundException: Could not find a part of the path
'Z:\filename.ext'.
at System.IO.__Error.WinIOError(Int32 errorCode, String
maybeFullPath)
at System.IO.FileStream.Init(String path, FileMode mode, FileAccess
access, Int32 rights, Boolean useRights, FileShare share, Int32
bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String
msgPath, Boolean bFromProxy)
at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess
access, FileShare share)
at Service.GetPersonObject(Int32 IdPerso) in
C:\Inetpub\wwwroot\WebServicePerson\WebServicePers on\App_Code\Service.vb:line
1152

I've seen many topics here where it says to give rights to Asp user.
I've made it. Somebody says to make impersonate application and I have
made it too

<identity impersonate="true" userName="user" password="pwd"/>

But i'm still having this problem. Could someone help me?

In fact i'm trying to access these files through a map drive to test
access with webservices throug the network layer. If we make it only
with a shared folder, does windows use the same implementation of
network layer?

I'm waiting some help impatiently ;-)

Gianfranco

Nov 19 '05 #2
Hi,

thanks you for this answer. I'm not very good with Server 2003. I have
tried to change some security but there is always the same error. Could
someone tell me which security policy to change?

thank you

Nov 19 '05 #3
"You need to give access to Network Services".

Can you elaborate a bit more on this???

Cheers

Ollie

"Cowboy (Gregory A. Beamer) - MVP" <No************@comcast.netNoSpamM> wrote
in message news:D2**********************************@microsof t.com...
With windows Server 2003, you need to give access to Network Service. Be wary of opening up security too much.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

***************************
Think Outside the Box!
***************************
"Gianfranco" wrote:
Hi everybody,

First of all, sorry for my english if it isn't perfect ;-p

I have an error in an asp.net application.

I have win2003 server, with iis 6. I'm developping with visual studio
2005, vb.net, framework 2

I'm trying to access some binary files stored in C: in server2003. if i
access them with C:\... it's fine. Now to access them quickly I work
with a Ramdisk (Y:) and it works fine if i access with Y:\....

If I make a shared folder and try to access them with
\\srv2003\sharedfolder\... it works fine too. But now I'm trying to
access them with a Network Drive Map (Z:) and I get this error :

System.IO.DirectoryNotFoundException: Could not find a part of the path
'Z:\filename.ext'.
at System.IO.__Error.WinIOError(Int32 errorCode, String
maybeFullPath)
at System.IO.FileStream.Init(String path, FileMode mode, FileAccess
access, Int32 rights, Boolean useRights, FileShare share, Int32
bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String
msgPath, Boolean bFromProxy)
at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess
access, FileShare share)
at Service.GetPersonObject(Int32 IdPerso) in
C:\Inetpub\wwwroot\WebServicePerson\WebServicePers on\App_Code\Service.vb:lin
e 1152

I've seen many topics here where it says to give rights to Asp user.
I've made it. Somebody says to make impersonate application and I have
made it too

<identity impersonate="true" userName="user" password="pwd"/>

But i'm still having this problem. Could someone help me?

In fact i'm trying to access these files through a map drive to test
access with webservices throug the network layer. If we make it only
with a shared folder, does windows use the same implementation of
network layer?

I'm waiting some help impatiently ;-)

Gianfranco

Nov 19 '05 #4
"YourMachineName\Network Service" is the account
which ASP.NET runs as in Windows Server 2003.

Give the necessary file access permissions to that account,
that it can access your Z: drive.
..

Juan T. Llibre
ASP.NET MVP
http://asp.net.do/foros/
Foros de ASP.NET en Español
Ven, y hablemos de ASP.NET...
======================

"Oliver Flint" <ol**********@hotmail.com> wrote in message
news:u1**************@TK2MSFTNGP09.phx.gbl...
"You need to give access to Network Services".

Can you elaborate a bit more on this???

Cheers

Ollie

"Cowboy (Gregory A. Beamer) - MVP" <No************@comcast.netNoSpamM> wrote
in message news:D2**********************************@microsof t.com...
With windows Server 2003, you need to give access to Network Service. Be

wary
of opening up security too much.

--
Gregory A. Beamer
"Gianfranco" wrote:
> Hi everybody,
>
> First of all, sorry for my english if it isn't perfect ;-p
>
> I have an error in an asp.net application.
>
> I have win2003 server, with iis 6. I'm developping with visual studio
> 2005, vb.net, framework 2
>
> I'm trying to access some binary files stored in C: in server2003. if i
> access them with C:\... it's fine. Now to access them quickly I work
> with a Ramdisk (Y:) and it works fine if i access with Y:\....
>
> If I make a shared folder and try to access them with
> \\srv2003\sharedfolder\... it works fine too. But now I'm trying to
> access them with a Network Drive Map (Z:) and I get this error :
>
> System.IO.DirectoryNotFoundException: Could not find a part of the path
> 'Z:\filename.ext'.
> at System.IO.__Error.WinIOError(Int32 errorCode, String
> maybeFullPath)
> at System.IO.FileStream.Init(String path, FileMode mode, FileAccess
> access, Int32 rights, Boolean useRights, FileShare share, Int32
> bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String
> msgPath, Boolean bFromProxy)
> at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess
> access, FileShare share)
> at Service.GetPersonObject(Int32 IdPerso) in
>

C:\Inetpub\wwwroot\WebServicePerson\WebServicePers on\App_Code\Service.vb:lin
e > 1152
>
> I've seen many topics here where it says to give rights to Asp user.
> I've made it. Somebody says to make impersonate application and I have
> made it too
>
> <identity impersonate="true" userName="user" password="pwd"/>
>
> But i'm still having this problem. Could someone help me?
>
> In fact i'm trying to access these files through a map drive to test
> access with webservices throug the network layer. If we make it only
> with a shared folder, does windows use the same implementation of
> network layer?
>
> I'm waiting some help impatiently ;-)
>
> Gianfranco
>
>


Nov 19 '05 #5
Could you please elaborate a bit more on this or supply a link???

Cheers

Ollie

"Cowboy (Gregory A. Beamer) - MVP" <No************@comcast.netNoSpamM> wrote
in message news:D2**********************************@microsof t.com...
With windows Server 2003, you need to give access to Network Service. Be wary of opening up security too much.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

***************************
Think Outside the Box!
***************************
"Gianfranco" wrote:
Hi everybody,

First of all, sorry for my english if it isn't perfect ;-p

I have an error in an asp.net application.

I have win2003 server, with iis 6. I'm developping with visual studio
2005, vb.net, framework 2

I'm trying to access some binary files stored in C: in server2003. if i
access them with C:\... it's fine. Now to access them quickly I work
with a Ramdisk (Y:) and it works fine if i access with Y:\....

If I make a shared folder and try to access them with
\\srv2003\sharedfolder\... it works fine too. But now I'm trying to
access them with a Network Drive Map (Z:) and I get this error :

System.IO.DirectoryNotFoundException: Could not find a part of the path
'Z:\filename.ext'.
at System.IO.__Error.WinIOError(Int32 errorCode, String
maybeFullPath)
at System.IO.FileStream.Init(String path, FileMode mode, FileAccess
access, Int32 rights, Boolean useRights, FileShare share, Int32
bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String
msgPath, Boolean bFromProxy)
at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess
access, FileShare share)
at Service.GetPersonObject(Int32 IdPerso) in
C:\Inetpub\wwwroot\WebServicePerson\WebServicePers on\App_Code\Service.vb:lin
e 1152

I've seen many topics here where it says to give rights to Asp user.
I've made it. Somebody says to make impersonate application and I have
made it too

<identity impersonate="true" userName="user" password="pwd"/>

But i'm still having this problem. Could someone help me?

In fact i'm trying to access these files through a map drive to test
access with webservices throug the network layer. If we make it only
with a shared folder, does windows use the same implementation of
network layer?

I'm waiting some help impatiently ;-)

Gianfranco

Nov 19 '05 #6
Hi

I've added this account and given to it "full control" access but it
always don't work correct.

any idea?

P.S. Oliver, what will you that I elaborate more?

Nov 19 '05 #7
Sorry. Ingnore my second post. There is something wrong with my new
reader

Nov 19 '05 #8
Juan,

Why must I give the Network Services account permission when I am
impersonating? What is the point of impersonating if I do that???

Ollie

Nov 19 '05 #9
Oliver,

You had never mentioned you were impersonating, until now.

Obviously, if you are impersonating, it's the account which
ASP.NET is impersonating which needs the access permissions.

This all boils down to giving the account ASP.NET is running
under, *whichever account that is* the necessary permissions.

If you have doubts about which account ASP.NET is running under,
just run this short script. It will identify ASP.NET's current identity.

identity.aspx
-------------
<%@ Page Language="VB" %>
<%@ Import NameSpace = System.Security.Principal %>
<script runat="server">
Sub Page_Load()
Dim tmp As String = WindowsIdentity.GetCurrent.Name()
Label1.Text = tmp
End Sub
</script>
<html>
<head>
<title>WindowsIdentity.GetCurrent.Name()</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:Label ID="Label1" Runat="server" Text="Label"></asp:Label>
</div>
</form>
</body>
</html>
--------

Hope this helps...

Juan T. Llibre
ASP.NET MVP
http://asp.net.do/foros/
Foros de ASP.NET en Español
Ven, y hablemos de ASP.NET...
======================

<ol*********@gmail.com> wrote in message
news:11*********************@f14g2000cwb.googlegro ups.com...
Juan,

Why must I give the Network Services account permission when I am
impersonating? What is the point of impersonating if I do that???

Ollie

Nov 19 '05 #10
Thanks. I'll try that.

P.S. I will quote this from Gianfranco's original post...
....
<identity impersonate="true" userName="user" password="pwd"/>
....

Nov 19 '05 #11
Sure. *He* did.
You didn't. ;-)

I thought you were having a similar problem,
but you didn't mention that you impersonated.

In either case, whether you are impersonating or not, running
that script will identify the correct account to grant permissions to.

Juan T. Llibre
ASP.NET MVP
http://asp.net.do/foros/
Foros de ASP.NET en Español
Ven, y hablemos de ASP.NET...
======================

"Ollie" <ol*********@gmail.com> wrote in message
news:11**********************@o13g2000cwo.googlegr oups.com...
Thanks. I'll try that.

P.S. I will quote this from Gianfranco's original post...
...
<identity impersonate="true" userName="user" password="pwd"/>
...

Nov 19 '05 #12
Thanks.

All my posts where regarding the original topic/post. If my problem was
different I would have started a new topic/post.

Gianfranco, If you are still having this problem and have the
impersonate set to true, you will need to grant access to the user you
are impersonating not the Network Service account.

Ollie

Nov 19 '05 #13
Hi,

Thanks for your help to everybody, but I'm still having my problem,
grrr!

here's my webconfig file :

<?xml version="1.0"?>
<configuration
xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0">
<appSettings>
<add key="myApplication.myServer.Service"
value="http://127.0.0.1/WebServicePerson/Service.asmx"/>

</appSettings>
<system.web>
<identity impersonate="true" userName="Gianfranco"
password="xxxxxx"/>

<webServices>
<protocols>
<add name="HttpGet"/>
<add name="HttpPost"/>
</protocols>
</webServices>
<compilation debug="true"/>
</system.web>

</configuration>

And I have granted permissions to the user Gianfranco, but always the
same error.

Is there maybe something with my RamDisk? Could we make a map drive
with no problem to a ramdisk?

Thank you

Nov 19 '05 #14
I'm not sure how RamDisk's and NTFS work together. Have you tried it on
a standard share???

Ollie

Nov 19 '05 #15

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
4474
by: Alex | last post by:
Hello, in my company, we have a diagnostic tool for hardware. Depending on the hardware projcet, a different project configuration is needed. The configuration file is written in XML and...
1
296
by: Vinnie | last post by:
From Hosting Reseller http://www.technolojik.net/windows.htm Has anyone seen this before. Looks as tough ASP.NET was not installed correctly. Thanks Server Error in '/news' Application....
0
1135
by: jessica | last post by:
Hi, I got a problem "Could not find a part of the path". On my loca machine I mapped the V:\LoggerNet to a remote server folder where th real-time data come in. I checked the file, it gets updated...
1
2229
by: Steve | last post by:
Hi all, I am referring to this article in MSDN : http://msdn.microsoft.com/library/en-us/secauthn/security/logonuser.asp While creating folder on the remote machine, we are specifying the UNC...
2
2205
by: Ross | last post by:
Hi I have an application using asp.net that I am running on my PC. The web form has a text box where you can enter a name for a new Photo category then click on the button. The code is...
9
3185
by: Tim D | last post by:
Hi, I originally posted this as a reply to a rather old thread in dotnet.framework.general and didn't get any response. I thought it might be more relevant here; anyone got any ideas? My...
5
1817
by: Patrick | last post by:
I understand it is built in behaviour that if an ASP.NET's web.config is set to: <customErrors mode="RemoteOnly" /> then I only get a detailed error message on screen when the ASP.NET...
5
4671
by: Nathan Sokalski | last post by:
I am trying to write code to allow my users to upload a file. The code I am using is as follows: Dim upfilename As String = "" If fileDetails.Value <> "" AndAlso...
8
1950
by: mohit | last post by:
Hi, I am creating a web application in Web Matrix on the .NET framework. I have two directories :AddUser and FormAuth in a Directory P. AddUser contains a file AddUser.aspx FormAuth contains :...
10
6933
by: happyse27 | last post by:
Hi All, I got this apache errors(see section A1 and A2 below) when I used a html(see section b below) to activate acctman.pl(see section c below). Section D below is part of the configuration...
0
7259
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7158
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7380
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7535
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
7523
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5683
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5085
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4745
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
1
798
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.