By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
425,719 Members | 1,046 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 425,719 IT Pros & Developers. It's quick & easy.

System.IO.IOException: Cannot create a file when that file already exists.

P: n/a
Getting the following error on my production server whether the file exists
or not:

"System.IO.IOException: Cannot create a file when that file already exists."

Here's the code generating the error (seems to be happening when I try
creating a directory)

If dirmgr.Exists("s:\blah\" & txt_name.Text) Then
lblerror.Text = lblerror.Text & "Unable to build physical path. " &
txt_name.Text & " & Contact Dev Team.<BR>"
Else
dirmgr.CreateDirectory("s:\blah\" & txt_name.Text)

This code runs fine on my development server (only the path is c:\blah\blah
instead of S). Also, my production server has failover cluser, and the s
drive is the failover drive. I can't imagine that could be a problem, but
thought I would mention it.

Asside from that, the only other thing I can think of is that the framework
version on my dev box says 1.1, and the one on my production server says:
1.0.37 - surely that's not the cause is it? Permissions shouldn't be an
issue (i've even tried as domain admin)

I would appreciate any help on this, as I'm out of ideas, and can find no
other documentation on this.
- Chad
Nov 17 '05 #1
Share this Question
Share on Google+
6 Replies


P: n/a
Hi,

the default user that runs web application (system) donít has rights to
access network resources.

Natty Gur, CTO
Dao2Com Ltd.
34th Elkalay st. Raanana
Israel , 43000
Phone Numbers:
Office: +972-(0)9-7740261
Fax: +972-(0)9-7740261
Mobile: +972-(0)58-888377
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 17 '05 #2

P: n/a
I agree with Natty. The problem you are having is most likely caused by
having no right to access network resources. Willy address a similar
problem before. See
http://groups.google.com/groups?q=Sy...t&start=10&hl=
en&lr=&ie=UTF-8&oe=UTF-8&selm=OELVHLBNCHA.2460%40tkmsftngp04&rnum=20.

HTH,
-Allen

Disclaimer:
This posting is provided "AS IS" with no warranties, and confers no rights.
Got .Net? http://www.gotdotnet.com

--------------------
| From: "Chad Crowder" <ch**********@gis.leica-geosystems.com>
| Subject: System.IO.IOException: Cannot create a file when that file
already exists.
| Date: Wed, 6 Aug 2003 17:08:27 -0400
| Lines: 29
|
| Getting the following error on my production server whether the file
exists
| or not:
|
| "System.IO.IOException: Cannot create a file when that file already
exists."
|
| Here's the code generating the error (seems to be happening when I try
| creating a directory)
|
| If dirmgr.Exists("s:\blah\" & txt_name.Text) Then
| lblerror.Text = lblerror.Text & "Unable to build physical path. "
&
| txt_name.Text & " & Contact Dev Team.<BR>"
| Else
| dirmgr.CreateDirectory("s:\blah\" & txt_name.Text)
|
| This code runs fine on my development server (only the path is
c:\blah\blah
| instead of S). Also, my production server has failover cluser, and the s
| drive is the failover drive. I can't imagine that could be a problem, but
| thought I would mention it.
|
| Asside from that, the only other thing I can think of is that the
framework
| version on my dev box says 1.1, and the one on my production server says:
| 1.0.37 - surely that's not the cause is it? Permissions shouldn't be an
| issue (i've even tried as domain admin)
|
| I would appreciate any help on this, as I'm out of ideas, and can find no
| other documentation on this.
| - Chad
|
|
|

Nov 17 '05 #3

P: n/a
Thanks for the response.

I understand that, but I'm trying to create a directory on the local drive.
This isn't a mapped share. The drive is physically present on the web
server, and if that web server fails, the other system physically takes over
the drive (ie, a cluster). I've also added the local ASPNET account to the
NTFS permissions on the folder, and it still fails.

- Chad
"[MSFT]Allen" <yw***@online.microsoft.com> wrote in message
news:j1**************@cpmsftngxa06.phx.gbl...
I agree with Natty. The problem you are having is most likely caused by
having no right to access network resources. Willy address a similar
problem before. See
http://groups.google.com/groups?q=Sy...t&start=10&hl= en&lr=&ie=UTF-8&oe=UTF-8&selm=OELVHLBNCHA.2460%40tkmsftngp04&rnum=20.

HTH,
-Allen

Disclaimer:
This posting is provided "AS IS" with no warranties, and confers no rights. Got .Net? http://www.gotdotnet.com

--------------------
| From: "Chad Crowder" <ch**********@gis.leica-geosystems.com>
| Subject: System.IO.IOException: Cannot create a file when that file
already exists.
| Date: Wed, 6 Aug 2003 17:08:27 -0400
| Lines: 29
|
| Getting the following error on my production server whether the file
exists
| or not:
|
| "System.IO.IOException: Cannot create a file when that file already
exists."
|
| Here's the code generating the error (seems to be happening when I try
| creating a directory)
|
| If dirmgr.Exists("s:\blah\" & txt_name.Text) Then
| lblerror.Text = lblerror.Text & "Unable to build physical path. " &
| txt_name.Text & " & Contact Dev Team.<BR>"
| Else
| dirmgr.CreateDirectory("s:\blah\" & txt_name.Text)
|
| This code runs fine on my development server (only the path is
c:\blah\blah
| instead of S). Also, my production server has failover cluser, and the s | drive is the failover drive. I can't imagine that could be a problem, but | thought I would mention it.
|
| Asside from that, the only other thing I can think of is that the
framework
| version on my dev box says 1.1, and the one on my production server says: | 1.0.37 - surely that's not the cause is it? Permissions shouldn't be an
| issue (i've even tried as domain admin)
|
| I would appreciate any help on this, as I'm out of ideas, and can find no | other documentation on this.
| - Chad
|
|
|

Nov 17 '05 #4

P: n/a
It doesn't work creating folders under the same directory as the web
application... same issue.

I'm going to try figuring out why that server is showing that it's running
version 1.03 of the dotnet framework. It shows that v1.1 was installed.

Thanks,
Chad

"[MSFT]Allen" <yw***@online.microsoft.com> wrote in message
news:RT**************@cpmsftngxa06.phx.gbl...
Try creating a directory in your code under the folder where your web
application resides. Does it works? In addition, you may want to verify the account your web application is running under. Please download tokedump
written by Keith Brown from
http://msdn.microsoft.com/msdnmag/is...y/default.aspx. It
would show you what account the application is running under.

-Allen

Disclaimer:
This posting is provided "AS IS" with no warranties, and confers no rights. Got .Net? http://www.gotdotnet.com

--------------------
| From: "Chad Crowder" <ch**********@gis.leica-geosystems.com>
| References: <ua**************@TK2MSFTNGP10.phx.gbl>
<j1**************@cpmsftngxa06.phx.gbl>
| Subject: Re: System.IO.IOException: Cannot create a file when that file
already exists.
| Date: Thu, 7 Aug 2003 08:11:44 -0400
| Lines: 78
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
| Message-ID: <ex**************@TK2MSFTNGP12.phx.gbl>
| Newsgroups: microsoft.public.dotnet.framework.aspnet
| NNTP-Posting-Host: 12.108.244.117
| Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTN GP12.phx.gbl
| Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.framework.aspnet:165699 | X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
|
| Thanks for the response.
|
| I understand that, but I'm trying to create a directory on the local
drive.
| This isn't a mapped share. The drive is physically present on the web
| server, and if that web server fails, the other system physically takes
over
| the drive (ie, a cluster). I've also added the local ASPNET account to
the
| NTFS permissions on the folder, and it still fails.
|
| - Chad
|
|
| "[MSFT]Allen" <yw***@online.microsoft.com> wrote in message
| news:j1**************@cpmsftngxa06.phx.gbl...
| > I agree with Natty. The problem you are having is most likely caused by | > having no right to access network resources. Willy address a similar
| > problem before. See
| >
|
http://groups.google.com/groups?q=Sy...t&start=10&hl= | > en&lr=&ie=UTF-8&oe=UTF-8&selm=OELVHLBNCHA.2460%40tkmsftngp04&rnum=20.
| >
| > HTH,
| > -Allen
| >
| > Disclaimer:
| > This posting is provided "AS IS" with no warranties, and confers no
| rights.
| > Got .Net? http://www.gotdotnet.com
| >
| > --------------------
| > | From: "Chad Crowder" <ch**********@gis.leica-geosystems.com>
| > | Subject: System.IO.IOException: Cannot create a file when that file
| > already exists.
| > | Date: Wed, 6 Aug 2003 17:08:27 -0400
| > | Lines: 29
| > |
| > | Getting the following error on my production server whether the file
| > exists
| > | or not:
| > |
| > | "System.IO.IOException: Cannot create a file when that file already
| > exists."
| > |
| > | Here's the code generating the error (seems to be happening when I try | > | creating a directory)
| > |
| > | If dirmgr.Exists("s:\blah\" & txt_name.Text) Then
| > | lblerror.Text = lblerror.Text & "Unable to build physical
path.
| "
| > &
| > | txt_name.Text & " & Contact Dev Team.<BR>"
| > | Else
| > | dirmgr.CreateDirectory("s:\blah\" & txt_name.Text)
| > |
| > | This code runs fine on my development server (only the path is
| > c:\blah\blah
| > | instead of S). Also, my production server has failover cluser, and
the
| s
| > | drive is the failover drive. I can't imagine that could be a problem, | but
| > | thought I would mention it.
| > |
| > | Asside from that, the only other thing I can think of is that the
| > framework
| > | version on my dev box says 1.1, and the one on my production server
| says:
| > | 1.0.37 - surely that's not the cause is it? Permissions shouldn't be an
| > | issue (i've even tried as domain admin)
| > |
| > | I would appreciate any help on this, as I'm out of ideas, and can find | no
| > | other documentation on this.
| > | - Chad
| > |
| > |
| > |
| >
|
|
|

Nov 17 '05 #5

P: n/a
Chad, was the problem resolved? It seems that you installed both v1.03 and
v1.1 on the same web server. If so, it might be helpful to look at the
article "Compatibility Considerations and Version Changes" on
http://www.gotdotnet.com/team/changeinfo/default.aspx. Try configuring your
web application to run V1.03 and V1.1 specifically to see how it works.

-Allen

Disclaimer:
This posting is provided "AS IS" with no warranties, and confers no rights.
Got .Net? http://www.gotdotnet.com

--------------------
| From: "Chad Crowder" <ch**********@gis.leica-geosystems.com>
| References: <ua**************@TK2MSFTNGP10.phx.gbl>
<j1**************@cpmsftngxa06.phx.gbl>
<ex**************@TK2MSFTNGP12.phx.gbl>
<RT**************@cpmsftngxa06.phx.gbl>
| Subject: Re: System.IO.IOException: Cannot create a file when that file
already exists.
| Date: Mon, 11 Aug 2003 01:16:22 -0400
| Lines: 141
|
|
| It doesn't work creating folders under the same directory as the web
| application... same issue.
|
| I'm going to try figuring out why that server is showing that it's running
| version 1.03 of the dotnet framework. It shows that v1.1 was installed.
|
| Thanks,
| Chad
|
| "[MSFT]Allen" <yw***@online.microsoft.com> wrote in message
| news:RT**************@cpmsftngxa06.phx.gbl...
| > Try creating a directory in your code under the folder where your web
| > application resides. Does it works? In addition, you may want to verify
| the
| > account your web application is running under. Please download tokedump
| > written by Keith Brown from
| > http://msdn.microsoft.com/msdnmag/is...y/default.aspx. It
| > would show you what account the application is running under.
| >
| > -Allen
| >
| > Disclaimer:
| > This posting is provided "AS IS" with no warranties, and confers no
| rights.
| > Got .Net? http://www.gotdotnet.com
| >
| > --------------------
| > | From: "Chad Crowder" <ch**********@gis.leica-geosystems.com>
| > | References: <ua**************@TK2MSFTNGP10.phx.gbl>
| > <j1**************@cpmsftngxa06.phx.gbl>
| > | Subject: Re: System.IO.IOException: Cannot create a file when that
file
| > already exists.
| > | Date: Thu, 7 Aug 2003 08:11:44 -0400
| > | Lines: 78
| > | X-Priority: 3
| > | X-MSMail-Priority: Normal
| > | X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
| > | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
| > | Message-ID: <ex**************@TK2MSFTNGP12.phx.gbl>
| > | Newsgroups: microsoft.public.dotnet.framework.aspnet
| > | NNTP-Posting-Host: 12.108.244.117
| > | Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTN GP12.phx.gbl
| > | Xref: cpmsftngxa06.phx.gbl
| microsoft.public.dotnet.framework.aspnet:165699
| > | X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
| > |
| > | Thanks for the response.
| > |
| > | I understand that, but I'm trying to create a directory on the local
| > drive.
| > | This isn't a mapped share. The drive is physically present on the
web
| > | server, and if that web server fails, the other system physically
takes
| > over
| > | the drive (ie, a cluster). I've also added the local ASPNET account
to
| > the
| > | NTFS permissions on the folder, and it still fails.
| > |
| > | - Chad
| > |
| > |
| > | "[MSFT]Allen" <yw***@online.microsoft.com> wrote in message
| > | news:j1**************@cpmsftngxa06.phx.gbl...
| > | > I agree with Natty. The problem you are having is most likely caused
| by
| > | > having no right to access network resources. Willy address a similar
| > | > problem before. See
| > | >
| > |
| >
|
http://groups.google.com/groups?q=Sy...t&start=10&hl=
| > | >
en&lr=&ie=UTF-8&oe=UTF-8&selm=OELVHLBNCHA.2460%40tkmsftngp04&rnum=20.
| > | >
| > | > HTH,
| > | > -Allen
| > | >
| > | > Disclaimer:
| > | > This posting is provided "AS IS" with no warranties, and confers no
| > | rights.
| > | > Got .Net? http://www.gotdotnet.com
| > | >
| > | > --------------------
| > | > | From: "Chad Crowder" <ch**********@gis.leica-geosystems.com>
| > | > | Subject: System.IO.IOException: Cannot create a file when that
file
| > | > already exists.
| > | > | Date: Wed, 6 Aug 2003 17:08:27 -0400
| > | > | Lines: 29
| > | > |
| > | > | Getting the following error on my production server whether the
file
| > | > exists
| > | > | or not:
| > | > |
| > | > | "System.IO.IOException: Cannot create a file when that file
already
| > | > exists."
| > | > |
| > | > | Here's the code generating the error (seems to be happening when I
| try
| > | > | creating a directory)
| > | > |
| > | > | If dirmgr.Exists("s:\blah\" & txt_name.Text) Then
| > | > | lblerror.Text = lblerror.Text & "Unable to build physical
| > path.
| > | "
| > | > &
| > | > | txt_name.Text & " & Contact Dev Team.<BR>"
| > | > | Else
| > | > | dirmgr.CreateDirectory("s:\blah\" & txt_name.Text)
| > | > |
| > | > | This code runs fine on my development server (only the path is
| > | > c:\blah\blah
| > | > | instead of S). Also, my production server has failover cluser,
and
| > the
| > | s
| > | > | drive is the failover drive. I can't imagine that could be a
| problem,
| > | but
| > | > | thought I would mention it.
| > | > |
| > | > | Asside from that, the only other thing I can think of is that the
| > | > framework
| > | > | version on my dev box says 1.1, and the one on my production
server
| > | says:
| > | > | 1.0.37 - surely that's not the cause is it? Permissions shouldn't
| be
| > an
| > | > | issue (i've even tried as domain admin)
| > | > |
| > | > | I would appreciate any help on this, as I'm out of ideas, and can
| find
| > | no
| > | > | other documentation on this.
| > | > | - Chad
| > | > |
| > | > |
| > | > |
| > | >
| > |
| > |
| > |
| >
|
|
|

Nov 17 '05 #6

P: n/a
Allen,

Thanks for the followup. I actually got my program working late last night.
The problem was the framework version.

I tried simply configuring the web application to use version 1.1, but that
didn't help. I also tried uninstalling then reinstalling framework version
1.1, but that also didn't get IIS to start using version 1.1 by default. I
consequently uninstalled versions 1.1 *and* version 1.03, then only
reinstalled version 1.1 again, and this took care of the problem.

Thanks again for all the help everyone!

- Chad

"[MSFT]Allen" <yw***@online.microsoft.com> wrote in message
news:hN**************@cpmsftngxa06.phx.gbl...
Chad, was the problem resolved? It seems that you installed both v1.03 and
v1.1 on the same web server. If so, it might be helpful to look at the
article "Compatibility Considerations and Version Changes" on
http://www.gotdotnet.com/team/changeinfo/default.aspx. Try configuring your web application to run V1.03 and V1.1 specifically to see how it works.

-Allen

Disclaimer:
This posting is provided "AS IS" with no warranties, and confers no rights. Got .Net? http://www.gotdotnet.com

--------------------
| From: "Chad Crowder" <ch**********@gis.leica-geosystems.com>
| References: <ua**************@TK2MSFTNGP10.phx.gbl>
<j1**************@cpmsftngxa06.phx.gbl>
<ex**************@TK2MSFTNGP12.phx.gbl>
<RT**************@cpmsftngxa06.phx.gbl>
| Subject: Re: System.IO.IOException: Cannot create a file when that file
already exists.
| Date: Mon, 11 Aug 2003 01:16:22 -0400
| Lines: 141
|
|
| It doesn't work creating folders under the same directory as the web
| application... same issue.
|
| I'm going to try figuring out why that server is showing that it's running | version 1.03 of the dotnet framework. It shows that v1.1 was installed.
|
| Thanks,
| Chad
|
| "[MSFT]Allen" <yw***@online.microsoft.com> wrote in message
| news:RT**************@cpmsftngxa06.phx.gbl...
| > Try creating a directory in your code under the folder where your web
| > application resides. Does it works? In addition, you may want to verify | the
| > account your web application is running under. Please download tokedump | > written by Keith Brown from
| > http://msdn.microsoft.com/msdnmag/is...y/default.aspx. It | > would show you what account the application is running under.
| >
| > -Allen
| >
| > Disclaimer:
| > This posting is provided "AS IS" with no warranties, and confers no
| rights.
| > Got .Net? http://www.gotdotnet.com
| >
| > --------------------
| > | From: "Chad Crowder" <ch**********@gis.leica-geosystems.com>
| > | References: <ua**************@TK2MSFTNGP10.phx.gbl>
| > <j1**************@cpmsftngxa06.phx.gbl>
| > | Subject: Re: System.IO.IOException: Cannot create a file when that
file
| > already exists.
| > | Date: Thu, 7 Aug 2003 08:11:44 -0400
| > | Lines: 78
| > | X-Priority: 3
| > | X-MSMail-Priority: Normal
| > | X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
| > | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
| > | Message-ID: <ex**************@TK2MSFTNGP12.phx.gbl>
| > | Newsgroups: microsoft.public.dotnet.framework.aspnet
| > | NNTP-Posting-Host: 12.108.244.117
| > | Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTN GP12.phx.gbl
| > | Xref: cpmsftngxa06.phx.gbl
| microsoft.public.dotnet.framework.aspnet:165699
| > | X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
| > |
| > | Thanks for the response.
| > |
| > | I understand that, but I'm trying to create a directory on the local
| > drive.
| > | This isn't a mapped share. The drive is physically present on the
web
| > | server, and if that web server fails, the other system physically
takes
| > over
| > | the drive (ie, a cluster). I've also added the local ASPNET account
to
| > the
| > | NTFS permissions on the folder, and it still fails.
| > |
| > | - Chad
| > |
| > |
| > | "[MSFT]Allen" <yw***@online.microsoft.com> wrote in message
| > | news:j1**************@cpmsftngxa06.phx.gbl...
| > | > I agree with Natty. The problem you are having is most likely caused | by
| > | > having no right to access network resources. Willy address a similar | > | > problem before. See
| > | >
| > |
| >
|
http://groups.google.com/groups?q=Sy...t&start=10&hl= | > | >
en&lr=&ie=UTF-8&oe=UTF-8&selm=OELVHLBNCHA.2460%40tkmsftngp04&rnum=20.
| > | >
| > | > HTH,
| > | > -Allen
| > | >
| > | > Disclaimer:
| > | > This posting is provided "AS IS" with no warranties, and confers no | > | rights.
| > | > Got .Net? http://www.gotdotnet.com
| > | >
| > | > --------------------
| > | > | From: "Chad Crowder" <ch**********@gis.leica-geosystems.com>
| > | > | Subject: System.IO.IOException: Cannot create a file when that
file
| > | > already exists.
| > | > | Date: Wed, 6 Aug 2003 17:08:27 -0400
| > | > | Lines: 29
| > | > |
| > | > | Getting the following error on my production server whether the
file
| > | > exists
| > | > | or not:
| > | > |
| > | > | "System.IO.IOException: Cannot create a file when that file
already
| > | > exists."
| > | > |
| > | > | Here's the code generating the error (seems to be happening when I | try
| > | > | creating a directory)
| > | > |
| > | > | If dirmgr.Exists("s:\blah\" & txt_name.Text) Then
| > | > | lblerror.Text = lblerror.Text & "Unable to build physical | > path.
| > | "
| > | > &
| > | > | txt_name.Text & " & Contact Dev Team.<BR>"
| > | > | Else
| > | > | dirmgr.CreateDirectory("s:\blah\" & txt_name.Text)
| > | > |
| > | > | This code runs fine on my development server (only the path is
| > | > c:\blah\blah
| > | > | instead of S). Also, my production server has failover cluser,
and
| > the
| > | s
| > | > | drive is the failover drive. I can't imagine that could be a
| problem,
| > | but
| > | > | thought I would mention it.
| > | > |
| > | > | Asside from that, the only other thing I can think of is that the | > | > framework
| > | > | version on my dev box says 1.1, and the one on my production
server
| > | says:
| > | > | 1.0.37 - surely that's not the cause is it? Permissions shouldn't | be
| > an
| > | > | issue (i've even tried as domain admin)
| > | > |
| > | > | I would appreciate any help on this, as I'm out of ideas, and can | find
| > | no
| > | > | other documentation on this.
| > | > | - Chad
| > | > |
| > | > |
| > | > |
| > | >
| > |
| > |
| > |
| >
|
|
|

Nov 17 '05 #7

This discussion thread is closed

Replies have been disabled for this discussion.