473,405 Members | 2,160 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

.net vbc : error BC30138 Unable to create temp file

Hi,

I'm quite frustrated in the fact that I can't even display a simple
"Hello World" message on .Net. I've been through all of the groups and
searched all over the place and haven't been able to figure out the
solution to this problem.

First off, the server is Windows Server 2003 - Web Edition (IIS 6) and
I'm using .Net Framework v1.1.4322.

The problem? When I try to view an ASPX page in the browser in vs.net
I get an error message that states as follows:

vbc : error BC30138: Unable to create temp file in path
'c:\windows\system32\inetsrv\%SYSTE~1\TEMP\': The directory name is
invalid.

Of course the directory name is invalid, it's supposed to be looking
for "C:\windows\temp\" but can't find it using "%systemroot%\temp\" for
some reason. (NOTE: I'm able to navigate to C:\Windows\Temp\ by typing
in %systemroot%\temp\ in windows explorer)

The compiler creates the temp files in
"C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\Temp orary ASP.NET Files"
with no problems, and I've modified this location to a different folder
and that works fine as well...the tempDirectory attribute in web.config
doesn't seem to be the problem.

I've checked the environment variable for TEMP and it's set to
"%SYSTEMROOT%\TEMP\" as it's supposed to be. I've even tried changing
this to another directory as well and without any luck.

I have set full control on the C:\WINDOWS\TEMP\ folder for the "NETWORK
SERVICE" user and this doesn't seem to help.

Any help that you can provide would be greatly appreciated.
Rob

Nov 19 '05 #1
10 4916
Hi, Rob.

Check whether you are impersonating or not, since the account
used by ASP.NET changes when you use impersonation.

Use this article as a permissions checklist, and verify that the
account you're using for ASP.NET has the NTFS permissions listed :

http://msdn.microsoft.com/library/de...l/secmod15.asp

Also, check the section titled : "To assign minimum privileges"
and make sure the account you're using for ASP.NET has the
account privileges listed.


Juan T. Llibre, ASP.NET MVP
ASP.NET FAQ : http://asp.net.do/faq/
Foros de ASP.NET en Español : http://asp.net.do/foros/
======================================
<ro********@gmail.com> wrote in message
news:11**********************@g44g2000cwa.googlegr oups.com...
Hi,

I'm quite frustrated in the fact that I can't even display a simple
"Hello World" message on .Net. I've been through all of the groups and
searched all over the place and haven't been able to figure out the
solution to this problem.

First off, the server is Windows Server 2003 - Web Edition (IIS 6) and
I'm using .Net Framework v1.1.4322.

The problem? When I try to view an ASPX page in the browser in vs.net
I get an error message that states as follows:

vbc : error BC30138: Unable to create temp file in path
'c:\windows\system32\inetsrv\%SYSTE~1\TEMP\': The directory name is
invalid.

Of course the directory name is invalid, it's supposed to be looking
for "C:\windows\temp\" but can't find it using "%systemroot%\temp\" for
some reason. (NOTE: I'm able to navigate to C:\Windows\Temp\ by typing
in %systemroot%\temp\ in windows explorer)

The compiler creates the temp files in
"C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\Temp orary ASP.NET Files"
with no problems, and I've modified this location to a different folder
and that works fine as well...the tempDirectory attribute in web.config
doesn't seem to be the problem.

I've checked the environment variable for TEMP and it's set to
"%SYSTEMROOT%\TEMP\" as it's supposed to be. I've even tried changing
this to another directory as well and without any luck.

I have set full control on the C:\WINDOWS\TEMP\ folder for the "NETWORK
SERVICE" user and this doesn't seem to help.

Any help that you can provide would be greatly appreciated.
Rob

Nov 19 '05 #2
Hi Juan,

Thanks for your response, your help is greatly appreciated. I went
through that article and I'm afraid I'm even more confused than I was
before. Do I want impersonation or not? What are the implications?

I checked in the web.config for that particular application and the
section in the article you sent me to is not in it.
<identity impersonate="true"
userName="registry:HKLM\SOFTWARE\YourSecureApp\
identity\ASPNET_SETREG,userName"
password="registry:HKLM\SOFTWARE\YourSecureApp\
identity\ASPNET_SETREG,password" />

Here's what's in my machine.config file for the processModel tag:
<processModel
enable="true"
timeout="Infinite"
idleTimeout="Infinite"
shutdownTimeout="0:00:05"
requestLimit="Infinite"
requestQueueLimit="5000"
restartQueueLimit="10"
memoryLimit="60"
webGarden="false"
cpuMask="0xffffffff"
userName="system"
password="AutoGenerate"
logLevel="Errors"
clientConnectedCheck="0:00:05"
comAuthenticationLevel="Connect"
comImpersonationLevel="Impersonate"
responseDeadlockInterval="00:03:00"
maxWorkerThreads="20"
maxIoThreads="20"
/>

Does comImpersonationLevel="Impersonate" mean that it's set to
impersonate?

I did the permissions checklist with the NETWORK SERVICE user and it
appears to be ok. How do I determine who the other user is under
impersonation?

Thanks again for your help.
Rob

"Juan T. Llibre" wrote:
Hi, Rob.

Check whether you are impersonating or not, since the account
used by ASP.NET changes when you use impersonation.

Use this article as a permissions checklist, and verify that the
account you're using for ASP.NET has the NTFS permissions listed :

http://msdn.microsoft.com/library/de...y/en-us/secmod /html/secmod15.asp
Also, check the section titled : "To assign minimum privileges"
and make sure the account you're using for ASP.NET has the
account privileges listed.


Juan T. Llibre, ASP.NET MVP
ASP.NET FAQ : http://asp.net.do/faq/
Foros de ASP.NET en Español : http://asp.net.do/foros/
======================================
<ro********@gmail.com> wrote in message
news:11**********************@g44g2000cwa.googleg roups.com...
Hi,

I'm quite frustrated in the fact that I can't even display a simple
"Hello World" message on .Net. I've been through all of the groups and searched all over the place and haven't been able to figure out the
solution to this problem.

First off, the server is Windows Server 2003 - Web Edition (IIS 6) and I'm using .Net Framework v1.1.4322.

The problem? When I try to view an ASPX page in the browser in vs.net I get an error message that states as follows:

vbc : error BC30138: Unable to create temp file in path
'c:\windows\system32\inetsrv\%SYSTE~1\TEMP\': The directory name is
invalid.

Of course the directory name is invalid, it's supposed to be looking
for "C:\windows\temp\" but can't find it using "%systemroot%\temp\" for some reason. (NOTE: I'm able to navigate to C:\Windows\Temp\ by typing in %systemroot%\temp\ in windows explorer)

The compiler creates the temp files in
"C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\Temp orary ASP.NET Files" with no problems, and I've modified this location to a different folder and that works fine as well...the tempDirectory attribute in web.config doesn't seem to be the problem.

I've checked the environment variable for TEMP and it's set to
"%SYSTEMROOT%\TEMP\" as it's supposed to be. I've even tried changing this to another directory as well and without any luck.

I have set full control on the C:\WINDOWS\TEMP\ folder for the "NETWORK SERVICE" user and this doesn't seem to help.

Any help that you can provide would be greatly appreciated.
Rob



--
Sent via .NET Newsgroups
http://www.dotnetnewsgroups.com
Nov 19 '05 #3
Hi Juan,

I also noticed at the top of this article that this doesn't seem to
apply to IIS 6.0 (without IIS 5 isolation mode enabled). I am running
IIS 6 and don't want to turn on IIS 5 isolation mode. I am using
Windows 2003 with IIS 6.0.

Here's a direct quote:

Applies To
This module applies to the following products and technologies:

Microsoft® Windows® XP or Windows 2000 Server (with Service Pack 3) and
later operating systems
Microsoft .NET Framework version 1.0 (with Service Pack 2) and later
versions
Internet Information Services (IIS) 5.0 or 6.0 (only when using IIS 5.0
isolation mode)

Thanks!
Rob

--
Sent via .NET Newsgroups
http://www.dotnetnewsgroups.com
Nov 19 '05 #4
From the web.config section you sent in,
it seems that you are using the System account:
userName="system"
Running ASP.NET as the System account is not recommended.

My ASP.NET 1.1 web.config has : userName="machine"

When I run the identity script listed below, from a 1.1 App directory,
I get back "NT AUTHORITY\NETWORK SERVICE " as the account
which ASP.NET 1.1 runs as.

You might get a different result.

You need to give *the account which ASP.NET is running as*
the access permissions to the directory.

Whether you are impersonating or not, run this script I wrote:

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>
---------

That script will return the account name ASP.NET is running under.

Then give *that* account the access permissions.
And make sure *that* account has the permissions in the article.

That will work 100% of the time.

Don't worry about the IIS version the article applies to,
as you commented in your other post.

This procedure will also work under IIS 6.0.

Let us know how you do.

Juan T. Llibre, ASP.NET MVP
ASP.NET FAQ : http://asp.net.do/faq/
Foros de ASP.NET en Español : http://asp.net.do/foros/
======================================
"Boost" <ro********@gmail.com> wrote in message
news:%2****************@tk2msftngp13.phx.gbl... Hi Juan,

Thanks for your response, your help is greatly appreciated. I went
through that article and I'm afraid I'm even more confused than I was
before. Do I want impersonation or not? What are the implications?

I checked in the web.config for that particular application and the
section in the article you sent me to is not in it.
<identity impersonate="true"
userName="registry:HKLM\SOFTWARE\YourSecureApp\
identity\ASPNET_SETREG,userName"
password="registry:HKLM\SOFTWARE\YourSecureApp\
identity\ASPNET_SETREG,password" />

Here's what's in my machine.config file for the processModel tag:
<processModel
enable="true"
timeout="Infinite"
idleTimeout="Infinite"
shutdownTimeout="0:00:05"
requestLimit="Infinite"
requestQueueLimit="5000"
restartQueueLimit="10"
memoryLimit="60"
webGarden="false"
cpuMask="0xffffffff"
userName="system"
password="AutoGenerate"
logLevel="Errors"
clientConnectedCheck="0:00:05"
comAuthenticationLevel="Connect"
comImpersonationLevel="Impersonate"
responseDeadlockInterval="00:03:00"
maxWorkerThreads="20"
maxIoThreads="20"
/>

Does comImpersonationLevel="Impersonate" mean that it's set to
impersonate?

I did the permissions checklist with the NETWORK SERVICE user and it
appears to be ok. How do I determine who the other user is under
impersonation?

Thanks again for your help.
Rob "Juan T. Llibre" wrote:
Hi, Rob.

Check whether you are impersonating or not, since the account
used by ASP.NET changes when you use impersonation.

Use this article as a permissions checklist, and verify that the
account you're using for ASP.NET has the NTFS permissions listed :

http://msdn.microsoft.com/library/de...y/en-us/secmod

/html/secmod15.asp

Also, check the section titled : "To assign minimum privileges"
and make sure the account you're using for ASP.NET has the
account privileges listed.


Juan T. Llibre, ASP.NET MVP
ASP.NET FAQ : http://asp.net.do/faq/
Foros de ASP.NET en Español : http://asp.net.do/foros/
======================================
<ro********@gmail.com> wrote in message
news:11**********************@g44g2000cwa.google groups.com...
Hi,

I'm quite frustrated in the fact that I can't even display a simple
"Hello World" message on .Net. I've been through all of the groups and searched all over the place and haven't been able to figure out the
solution to this problem.

First off, the server is Windows Server 2003 - Web Edition (IIS 6) and I'm using .Net Framework v1.1.4322.

The problem? When I try to view an ASPX page in the browser in vs.net I get an error message that states as follows:

vbc : error BC30138: Unable to create temp file in path
'c:\windows\system32\inetsrv\%SYSTE~1\TEMP\': The directory name is
invalid.

Of course the directory name is invalid, it's supposed to be looking
for "C:\windows\temp\" but can't find it using "%systemroot%\temp\" for some reason. (NOTE: I'm able to navigate to C:\Windows\Temp\ by typing in %systemroot%\temp\ in windows explorer)

The compiler creates the temp files in
"C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\Temp orary ASP.NET Files" with no problems, and I've modified this location to a different folder and that works fine as well...the tempDirectory attribute in web.config doesn't seem to be the problem.

I've checked the environment variable for TEMP and it's set to
"%SYSTEMROOT%\TEMP\" as it's supposed to be. I've even tried changing this to another directory as well and without any luck.

I have set full control on the C:\WINDOWS\TEMP\ folder for the "NETWORK SERVICE" user and this doesn't seem to help.

Any help that you can provide would be greatly appreciated.
Rob



--
Sent via .NET Newsgroups
http://www.dotnetnewsgroups.com

Nov 19 '05 #5
Hey Juan,

Thanks for the script, however, I can't run the script because when I do
I get the same error!! :)

So is there another way of finding this out?

Thanks!
Rob

--
Sent via .NET Newsgroups
http://www.dotnetnewsgroups.com
Nov 19 '05 #6
What I would suggest in that case is :

1. Change the ASP.NET account to "machine", instead of "system",
( in your web.config ) and verify that the correct NTFS permissions and
account privileges are given to the "NT AUTHORITY\NETWORK SERVICE"
account per the article at :

http://msdn.microsoft.com/library/de...l/secmod15.asp

2. Change the TEMP and TMP system environment variables to a different
directory, and perhaps even to a different drive, and add NTFS full control
permissions to the "NT AUTHORITY\NETWORK SERVICE" account
for that directory. That should fix your temp directory's permissions.

Then, try to run an aspx page again.

Juan T. Llibre, ASP.NET MVP
ASP.NET FAQ : http://asp.net.do/faq/
Foros de ASP.NET en Español : http://asp.net.do/foros/
======================================
"Boost" <ro********@gmail.com> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
Hey Juan,

Thanks for the script, however, I can't run the script because when I do
I get the same error!! :)

So is there another way of finding this out?

Thanks!
Rob

--
Sent via .NET Newsgroups
http://www.dotnetnewsgroups.com

Nov 19 '05 #7
Hi Juan,

#1. I've changed the machine.config file so that the userName is
"machine" instead of system and restarted IIS. I went through the
article and ran through the checklist for the NETWORK SERVICE user.

#2. I changed the system environment variable for both TEMP and TMP to
D:\TEMP\ and gave the appropriate permissions to that drive and TEMP
folder. Interestingly enough, I got the exact same error:

vbc : error BC30138: Unable to create temp file in path
'c:\windows\system32\inetsrv\%SYSTE~1\TEMP\': The directory name is
invalid.

Notice that it's still looking at "%SYSTE~1\TEMP\" even though I've
change the system environment variable to "D:\TEMP\".

Any ideas? Is there a configuration setting somewhere that I'm missing?
I've seen this problem in a thousand places on google, but no one seems
to be able to solve it.

Thanks,
Rob

"Juan T. Llibre" wrote:
What I would suggest in that case is :

1. Change the ASP.NET account to "machine", instead of "system",
( in your web.config ) and verify that the correct NTFS permissions and
account privileges are given to the "NT AUTHORITY\NETWORK SERVICE"
account per the article at :

http://msdn.microsoft.com/library/de...y/en-us/secmod /html/secmod15.asp
2. Change the TEMP and TMP system environment variables to a different
directory, and perhaps even to a different drive, and add NTFS full controlpermissions to the "NT AUTHORITY\NETWORK SERVICE" account
for that directory. That should fix your temp directory's permissions.

Then, try to run an aspx page again.

Juan T. Llibre, ASP.NET MVP
ASP.NET FAQ : http://asp.net.do/faq/
Foros de ASP.NET en Español : http://asp.net.do/foros/
======================================
"Boost" <ro********@gmail.com> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
Hey Juan,

Thanks for the script, however, I can't run the script because when I do I get the same error!! :)

So is there another way of finding this out?

Thanks!
Rob

--
Sent via .NET Newsgroups
http://www.dotnetnewsgroups.com



--
Sent via .NET Newsgroups
http://www.dotnetnewsgroups.com
Nov 19 '05 #8
Did you stop/start iis ?

Start Menu, Run "iisreset"

Also, the convention for TEMP directory
variables doesn't include the ending slash.

i.e., instead of using D:\TEMP\ , use D:\TEMP


Juan T. Llibre, ASP.NET MVP
ASP.NET FAQ : http://asp.net.do/faq/
Foros de ASP.NET en Español : http://asp.net.do/foros/
======================================
"Boost" <ro********@gmail.com> wrote in message
news:u0**************@TK2MSFTNGP10.phx.gbl...
Hi Juan,

#1. I've changed the machine.config file so that the userName is
"machine" instead of system and restarted IIS. I went through the
article and ran through the checklist for the NETWORK SERVICE user.

#2. I changed the system environment variable for both TEMP and TMP to
D:\TEMP\ and gave the appropriate permissions to that drive and TEMP
folder. Interestingly enough, I got the exact same error:

vbc : error BC30138: Unable to create temp file in path
'c:\windows\system32\inetsrv\%SYSTE~1\TEMP\': The directory name is
invalid.

Notice that it's still looking at "%SYSTE~1\TEMP\" even though I've
change the system environment variable to "D:\TEMP\".

Any ideas? Is there a configuration setting somewhere that I'm missing?
I've seen this problem in a thousand places on google, but no one seems
to be able to solve it.

Thanks,
Rob

"Juan T. Llibre" wrote:
What I would suggest in that case is :

1. Change the ASP.NET account to "machine", instead of "system",
( in your web.config ) and verify that the correct NTFS permissions and
account privileges are given to the "NT AUTHORITY\NETWORK SERVICE"
account per the article at :

http://msdn.microsoft.com/library/de...y/en-us/secmod

/html/secmod15.asp

2. Change the TEMP and TMP system environment variables to a different
directory, and perhaps even to a different drive, and add NTFS full

control
permissions to the "NT AUTHORITY\NETWORK SERVICE" account
for that directory. That should fix your temp directory's permissions.

Then, try to run an aspx page again.

Juan T. Llibre, ASP.NET MVP
ASP.NET FAQ : http://asp.net.do/faq/
Foros de ASP.NET en Español : http://asp.net.do/foros/
======================================
"Boost" <ro********@gmail.com> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl.. .
Hey Juan,

Thanks for the script, however, I can't run the script because when I do I get the same error!! :)

So is there another way of finding this out?

Thanks!
Rob

--
Sent via .NET Newsgroups
http://www.dotnetnewsgroups.com



--
Sent via .NET Newsgroups
http://www.dotnetnewsgroups.com

Nov 19 '05 #9
I restarted IIS and....IT WORKED!!!!!!!! Changing the TEMP system
variable to another folder (in my case a completely different drive) and
then restarting IIS appears to be the solution to this issue.

Thank you so much Juan! Your patience and time are greatly appreciated.
You don't know how frustrating this issue has been for me.

Thanks again!
Rob

--
Sent via .NET Newsgroups
http://www.dotnetnewsgroups.com
Nov 19 '05 #10
re:
I restarted IIS and....IT WORKED!!!!!!!!
<very big smile>

re: Thank you so much Juan!
You're very much welcome!

Juan T. Llibre, ASP.NET MVP
ASP.NET FAQ : http://asp.net.do/faq/
Foros de ASP.NET en Español : http://asp.net.do/foros/
======================================
"Boost" <ro********@gmail.com> wrote in message
news:%2***************@TK2MSFTNGP10.phx.gbl...I restarted IIS and....IT WORKED!!!!!!!! Changing the TEMP system
variable to another folder (in my case a completely different drive) and
then restarting IIS appears to be the solution to this issue.

Thank you so much Juan! Your patience and time are greatly appreciated.
You don't know how frustrating this issue has been for me.

Thanks again!
Rob

--
Sent via .NET Newsgroups
http://www.dotnetnewsgroups.com

Nov 19 '05 #11

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

Similar topics

2
by: JVRudnick | last post by:
Hello all... newbie here to .NET, but have dev asp pages for years. I'm trying to setup my workstation to now show .aspx pages - with no luck. I have the 1.1 NET framework installed, IIS5 and a...
3
by: James Proctor | last post by:
Hi there, im brand new to ASP. Ive done loads of VB coding and one of my clients is intrested in a web based application, so im trying to play on and learn it a tad. However im comming across lots...
5
by: sleepydj | last post by:
Hello, I have a simple program to create strings from the corresponding double/integer values. For any data type similar to int, I have a template set up in a file misc.h: ...
2
by: Jon | last post by:
Has anyone ever come across this error? When working on Web Applications I get the following when compliling. When I reboot my pc and compile a basic ASPX I am ok for about 30 min. After that...
1
by: James Proctor | last post by:
Hi there, im brand new to ASP. Ive done loads of VB coding and one of my clients is intrested in a web based application, so im trying to play on and learn it a tad. However im comming across lots...
0
by: HKSHK | last post by:
This list compares the error codes used in VB.NET 2003 with those used in VB6. Error Codes: ============ 3: This Error number is obsolete and no longer used. (Formerly: Return without GoSub)...
2
by: erbrose | last post by:
Hey friends i just wrote some code that finds a zip file in a folder, unzips it using system() call to winzip32.exe. the contents of zip is an oracle dmp file. I next use another system() call to...
3
by: =?Utf-8?B?VmFuZXNzYQ==?= | last post by:
Hi all! I am having problems on installing .NET Framework 3.5 on some machines. In one machine the error is: '.NET Framework 3.5' RunCheck result: Install Needed Verifying file integrity of...
10
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
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
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
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,...

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.