473,663 Members | 2,726 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\share dfolder\... 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.Direc toryNotFoundExc eption: Could not find a part of the path
'Z:\filename.ex t'.
at System.IO.__Err or.WinIOError(I nt32 errorCode, String
maybeFullPath)
at System.IO.FileS tream.Init(Stri ng path, FileMode mode, FileAccess
access, Int32 rights, Boolean useRights, FileShare share, Int32
bufferSize, FileOptions options, SECURITY_ATTRIB UTES secAttrs, String
msgPath, Boolean bFromProxy)
at System.IO.FileS tream..ctor(Str ing path, FileMode mode, FileAccess
access, FileShare share)
at Service.GetPers onObject(Int32 IdPerso) in
C:\Inetpub\wwwr oot\WebServiceP erson\WebServic ePerson\App_Cod e\Service.vb:li ne
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="tr ue" 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 9368
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\share dfolder\... 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.Direc toryNotFoundExc eption: Could not find a part of the path
'Z:\filename.ex t'.
at System.IO.__Err or.WinIOError(I nt32 errorCode, String
maybeFullPath)
at System.IO.FileS tream.Init(Stri ng path, FileMode mode, FileAccess
access, Int32 rights, Boolean useRights, FileShare share, Int32
bufferSize, FileOptions options, SECURITY_ATTRIB UTES secAttrs, String
msgPath, Boolean bFromProxy)
at System.IO.FileS tream..ctor(Str ing path, FileMode mode, FileAccess
access, FileShare share)
at Service.GetPers onObject(Int32 IdPerso) in
C:\Inetpub\wwwr oot\WebServiceP erson\WebServic ePerson\App_Cod e\Service.vb:li ne
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="tr ue" 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.netNoS pamM> wrote
in message news:D2******** *************** ***********@mic rosoft.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\share dfolder\... 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.Direc toryNotFoundExc eption: Could not find a part of the path
'Z:\filename.ex t'.
at System.IO.__Err or.WinIOError(I nt32 errorCode, String
maybeFullPath)
at System.IO.FileS tream.Init(Stri ng path, FileMode mode, FileAccess
access, Int32 rights, Boolean useRights, FileShare share, Int32
bufferSize, FileOptions options, SECURITY_ATTRIB UTES secAttrs, String
msgPath, Boolean bFromProxy)
at System.IO.FileS tream..ctor(Str ing path, FileMode mode, FileAccess
access, FileShare share)
at Service.GetPers onObject(Int32 IdPerso) in
C:\Inetpub\wwwr oot\WebServiceP erson\WebServic ePerson\App_Cod e\Service.vb:li n
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="tr ue" 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
"YourMachineNam e\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**********@h otmail.com> wrote in message
news:u1******** ******@TK2MSFTN GP09.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.netNoS pamM> wrote
in message news:D2******** *************** ***********@mic rosoft.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\share dfolder\... 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.Direc toryNotFoundExc eption: Could not find a part of the path
> 'Z:\filename.ex t'.
> at System.IO.__Err or.WinIOError(I nt32 errorCode, String
> maybeFullPath)
> at System.IO.FileS tream.Init(Stri ng path, FileMode mode, FileAccess
> access, Int32 rights, Boolean useRights, FileShare share, Int32
> bufferSize, FileOptions options, SECURITY_ATTRIB UTES secAttrs, String
> msgPath, Boolean bFromProxy)
> at System.IO.FileS tream..ctor(Str ing path, FileMode mode, FileAccess
> access, FileShare share)
> at Service.GetPers onObject(Int32 IdPerso) in
>

C:\Inetpub\wwwr oot\WebServiceP erson\WebServic ePerson\App_Cod e\Service.vb:li n
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="tr ue" 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.netNoS pamM> wrote
in message news:D2******** *************** ***********@mic rosoft.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\share dfolder\... 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.Direc toryNotFoundExc eption: Could not find a part of the path
'Z:\filename.ex t'.
at System.IO.__Err or.WinIOError(I nt32 errorCode, String
maybeFullPath)
at System.IO.FileS tream.Init(Stri ng path, FileMode mode, FileAccess
access, Int32 rights, Boolean useRights, FileShare share, Int32
bufferSize, FileOptions options, SECURITY_ATTRIB UTES secAttrs, String
msgPath, Boolean bFromProxy)
at System.IO.FileS tream..ctor(Str ing path, FileMode mode, FileAccess
access, FileShare share)
at Service.GetPers onObject(Int32 IdPerso) in
C:\Inetpub\wwwr oot\WebServiceP erson\WebServic ePerson\App_Cod e\Service.vb:li n
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="tr ue" 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.Nam e()
Label1.Text = tmp
End Sub
</script>
<html>
<head>
<title>WindowsI dentity.GetCurr ent.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*********@gm ail.com> wrote in message
news:11******** *************@f 14g2000cwb.goog legroups.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

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

Similar topics

1
4499
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 contains information for the visualization and storage of the retrieved data. From mid july till now, i have made 4 different configuration sets and everything was fine. Today, i got the order to make a new configuration set. When the xml file was...
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
1141
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 with th original server source. The code is like streamreader sr=null; sr = File.OpenText("V:\\LoggerNet\\newdata.dat"); text = sr.ReadToEnd(); But when I run the code, it gave error "Could not find a part of th
1
2232
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 path as per the example. But we get this error "could not find a part of the path". we are prefixing the path with @ symbol and also tried with the escaping the "\\".
2
2213
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 intended to create a new directory under Photos such as "Relatives".
9
3198
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 questions are below... "David Good" wrote: > We have a network running both Win2k and Win2k3 webservers and our web sites > reside on a UNC network share that happens to be a Network Appliance NAS.
5
1831
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 application is executed on the IIS server itself. However, I note that with the following
5
4683
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 fileDetails.PostedFile.ContentLength > 0 Then Dim dir As String() = fileDetails.PostedFile.FileName.Split("\".ToCharArray())
8
1953
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 : Default.aspx , Users.xml , Login.aspx I have the following code :
10
6960
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 of section c. Not sure where went wrong as the web page displayed internal server error. Also, what is the error 543? and error 2114. Where to find the list of errors in websites as it is not the standard apache error. I could not find...
0
8345
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8858
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8771
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
7371
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6186
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4349
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2763
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2000
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1757
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.