first web application and cs0016

M

Marc Pelletier

Hello all,

I've been putsing with c# for a few months now, and have finally built
something I would like to expose via the web. So I have created a new
solution, with a new web application, changed the name of the page to
start.aspx and put a label on it. I know, not much to show for 3 months
work! But when I go to run it I get the dreaded cs0016 compiler error.

CS0016: Could not write to output file 'c:\WINDOWS\Microsoft.NET\Framework
\v1.1.4322\Temporary ASP.NET Files\webapplication1\8dd84b00\b065eec7
\z1vcuoyo.dll' -- 'Access is denied. '

I've found a whole pile of references to this error and every one insists
the problem is with my file permissions. Well, I've gone into the IIS
management console and confirmed that WebApplication1 has anonymous access
for IUSR_machinename, I've opened up the c:\WINDOWS\Microsoft.NET
\Framework\v1.1.4322\Temporary ASP.NET Files path to Web sharing. I've been
banging my head on this for 2 days. All of my console apps ran no problem,
so I'm sure this is just a configuration problem of IIS, but what?

Can anyone point me to a definitive source of info, or give me any
pointers? Im a reasonably competent programmer, but have never done web
development.

Thanks

Marc Pelletier
 
J

John Soulis [MSFT]

First run aspnet_regiis -i from this folder at a command prompt.
c:\WINDOWS\Microsoft.NET\Framework
\v1.1.4322. If this does not correct the issue. Download filemon from
www.sysinternals.com. Run filemon and then reproduce the error. Then look
for an access denied in the filemon log. The easiest way to do this is to
save the log file and load it into Excel. Then you can sort on the columns.
This could tell you what process trying to access that folder and being
denied. Then you will know what process will need permissions to the
folder. My guess is it is the aspnet_wp.exe process.
Thank you,
John Soulis
Microsoft, ASP.NET

This posting is provided "AS IS", with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm
 
M

Marc Pelletier

(e-mail address removed) (John Soulis [MSFT]) wrote in
First run aspnet_regiis -i from this folder at a command prompt.
c:\WINDOWS\Microsoft.NET\Framework
\v1.1.4322. If this does not correct the issue.

Nope, this didn't work.
Download filemon
from www.sysinternals.com. Run filemon and then reproduce the error.
Then look for an access denied in the filemon log. The easiest way to
do this is to save the log file and load it into Excel. Then you can
sort on the columns. This could tell you what process trying to access
that folder and being denied. Then you will know what process will
need permissions to the folder. My guess is it is the aspnet_wp.exe
process.

I stopped the iis service, deleted the temporary internet files
directory, rebooted the machine, started filemon, then vs and tried to
run my web application. Then I stopped debugging and examined the log
file. I found several access denied instances:
inetinfo.exe:1840 IRP_MJ_CREATE C:\WINDOWS\TEMP\ ACCESS DENIED
TONKA\IUSR_TONKA
inetinfo.exe:1840 IRP_MJ_CREATE C:\WINDOWS\TEMP\ ACCESS DENIED
TONKA\IUSR_TONKA
inetinfo.exe:1840 IRP_MJ_CREATE C:\WINDOWS\TEMP\ ACCESS DENIED
TONKA\IUSR_TONKA
inetinfo.exe:1840 IRP_MJ_CREATE C:\WINDOWS\TEMP\ ACCESS DENIED
TONKA\IUSR_TONKA
aspnet_wp.exe:2176 IRP_MJ_CREATE C:\WINDOWS\T18ELRY5BIOU17EL
ACCESS DENIED TONKA\ASPNET
aspnet_wp.exe:2176 IRP_MJ_CREATE C:\Documents and Settings\TONKA
\ASPNET\Local Settings\Application Data\ApplicationHistory
\aspnet_wp.exe.bf16b455.ini.inuse ACCESS DENIED TONKA\ASPNET
aspnet_wp.exe:2176 IRP_MJ_CREATE C:\Documents and Settings\TONKA
\ASPNET\Local Settings\Application Data\ApplicationHistory
\b065eec7.bf16b455.ini.inuse ACCESS DENIED TONKA\ASPNET
csc.exe:2228 IRP_MJ_CREATE C:\DOCUME~1\TONKA\ASPNET\LOCALS~1
\Temp\RES3.tmp ACCESS DENIED TONKA\ASPNET
aspnet_wp.exe:2176 IRP_MJ_CREATE C:\Documents and Settings\TONKA
\ASPNET\Local Settings\Application Data\ApplicationHistory
\b065eec7.bf16b455.ini.inuse ACCESS DENIED TONKA\ASPNET
csc.exe:2392 IRP_MJ_CREATE C:\DOCUME~1\TONKA\ASPNET\LOCALS~1
\Temp\RES7.tmp ACCESS DENIED TONKA\ASPNET


I see that inetinfo and aspnet_wp.exe seem to have problems. Now, what do
I do about them? I've seen lots of references to giving processes
permissions, but I can't figure out how to do that. Inetinfo is running
as system, and aspnew_wp.exe is running as ASPNet.

The particular file that the compiler is complaining about not being able
to create is referenced several times with different extensions, and all
with a status of success. I've clipped the file paths but included all of
the accesses here:

aspnet_wp.exe:2176 IRP_MJ_CREATE ..\hwc3fn7y.0.cs
aspnet_wp.exe:2176 IRP_MJ_WRITE ..\hwc3fn7y.0.cs
aspnet_wp.exe:2176 IRP_MJ_CLEANUP ..\hwc3fn7y.0.cs
aspnet_wp.exe:2176 IRP_MJ_CLOSE ..\hwc3fn7y.0.cs
csc.exe:2392 IRP_MJ_CREATE ..\hwc3fn7y.0.cs
csc.exe:2392 FASTIO_QUERY_STANDARD_INFO ..\hwc3fn7y.0.cs
csc.exe:2392 IRP_MJ_READ ..\hwc3fn7y.0.cs
csc.exe:2392 IRP_MJ_CLEANUP ..\hwc3fn7y.0.cs
csc.exe:2392 IRP_MJ_CLOSE ..\hwc3fn7y.0.cs
aspnet_wp.exe:2176 IRP_MJ_CREATE ..\hwc3fn7y.cmdline
aspnet_wp.exe:2176 IRP_MJ_WRITE ..\hwc3fn7y.cmdline
aspnet_wp.exe:2176 IRP_MJ_CLEANUP ..\hwc3fn7y.cmdline
aspnet_wp.exe:2176 IRP_MJ_CLOSE ..\hwc3fn7y.cmdline
csc.exe:2392 IRP_MJ_CREATE ..\hwc3fn7y.cmdline
csc.exe:2392 FASTIO_QUERY_STANDARD_INFO ..\hwc3fn7y.cmdline
csc.exe:2392 IRP_MJ_READ ..\hwc3fn7y.cmdline
csc.exe:2392 IRP_MJ_CLEANUP ..\hwc3fn7y.cmdline
csc.exe:2392 IRP_MJ_CLOSE ..\hwc3fn7y.cmdline
aspnet_wp.exe:2176 IRP_MJ_CREATE ..\hwc3fn7y.dll
aspnet_wp.exe:2176 IRP_MJ_CLEANUP ..\hwc3fn7y.dll
aspnet_wp.exe:2176 IRP_MJ_CLOSE ..\hwc3fn7y.dll
aspnet_wp.exe:2176 FASTIO_QUERY_OPEN ..\hwc3fn7y.dll
aspnet_wp.exe:2176 IRP_MJ_CREATE ..\hwc3fn7y.dll
aspnet_wp.exe:2176 IRP_MJ_QUERY_INFORMATION ..\hwc3fn7y.dll
aspnet_wp.exe:2176 IRP_MJ_SET_INFORMATION ..\hwc3fn7y.dll
aspnet_wp.exe:2176 IRP_MJ_CLEANUP ..\hwc3fn7y.dll
aspnet_wp.exe:2176 IRP_MJ_CLOSE ..\hwc3fn7y.dll
aspnet_wp.exe:2176 IRP_MJ_CREATE ..\hwc3fn7y.err
csc.exe:2392 IRP_MJ_CLEANUP ..\hwc3fn7y.err
csc.exe:2392 IRP_MJ_CLOSE ..\hwc3fn7y.err
aspnet_wp.exe:2176 FASTIO_READ ..\hwc3fn7y.out
aspnet_wp.exe:2176 FASTIO_READ ..\hwc3fn7y.out
aspnet_wp.exe:2176 IRP_MJ_CREATE ..\hwc3fn7y.out
aspnet_wp.exe:2176 FASTIO_QUERY_STANDARD_INFO ..\hwc3fn7y.out
aspnet_wp.exe:2176 IRP_MJ_WRITE ..\hwc3fn7y.out
csc.exe:2392 FASTIO_WRITE ..\hwc3fn7y.out
csc.exe:2392 IRP_MJ_CLEANUP ..\hwc3fn7y.out
csc.exe:2392 IRP_MJ_CLOSE ..\hwc3fn7y.out
aspnet_wp.exe:2176 IRP_MJ_CREATE ..\hwc3fn7y.out
aspnet_wp.exe:2176 FASTIO_QUERY_STANDARD_INFO ..\hwc3fn7y.out
aspnet_wp.exe:2176 IRP_MJ_READ ..\hwc3fn7y.out
aspnet_wp.exe:2176 IRP_MJ_CLEANUP ..\hwc3fn7y.out
aspnet_wp.exe:2176 IRP_MJ_CLOSE ..\hwc3fn7y.out
csc.exe:2392 IRP_MJ_CREATE ..\hwc3fn7y.pdb
csc.exe:2392 IRP_MJ_CREATE ..\hwc3fn7y.pdb
csc.exe:2392 IRP_MJ_SET_INFORMATION ..\hwc3fn7y.pdb
csc.exe:2392 IRP_MJ_SET_INFORMATION ..\hwc3fn7y.pdb
csc.exe:2392 FASTIO_QUERY_STANDARD_INFO ..\hwc3fn7y.pdb
csc.exe:2392 FASTIO_QUERY_STANDARD_INFO ..\hwc3fn7y.pdb
csc.exe:2392 IRP_MJ_READ* ..\hwc3fn7y.pdb
System:4 IRP_MJ_QUERY_INFORMATION ..\hwc3fn7y.pdb
csc.exe:2392 IRP_MJ_WRITE* ..\hwc3fn7y.pdb
csc.exe:2392 FASTIO_QUERY_STANDARD_INFO ..\hwc3fn7y.pdb
csc.exe:2392 IRP_MJ_WRITE* ..\hwc3fn7y.pdb
csc.exe:2392 IRP_MJ_WRITE* ..\hwc3fn7y.pdb
csc.exe:2392 FASTIO_QUERY_STANDARD_INFO ..\hwc3fn7y.pdb
csc.exe:2392 FASTIO_QUERY_STANDARD_INFO ..\hwc3fn7y.pdb
csc.exe:2392 FASTIO_QUERY_STANDARD_INFO ..\hwc3fn7y.pdb
csc.exe:2392 IRP_MJ_WRITE* ..\hwc3fn7y.pdb
csc.exe:2392 IRP_MJ_SET_INFORMATION ..\hwc3fn7y.pdb
csc.exe:2392 IRP_MJ_SET_INFORMATION ..\hwc3fn7y.pdb
csc.exe:2392 IRP_MJ_CLEANUP ..\hwc3fn7y.pdb
csc.exe:2392 IRP_MJ_CLOSE ..\hwc3fn7y.pdb


I know this is a long post, but hopefully some useful information is in
there somewhere!

Thanks for any assistance.

Marc
 
J

John Soulis [MSFT]

You will need to give these two accounts, IUSR_TONKA and ASPNet,
permissions to the directories they are being denied acces to. You can do
this by right click the folder and going to properties. Then click the
security tab. Then click the add button. Add the account.
It is the account that the aspnet_wp.exe and the inetinfo.exe processes run
under that need to be granted access to the directories that they are being
denied access to.
I hope this helps.
Regards,
John Soulis
Microsoft, ASP.NET

This posting is provided "AS IS", with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm
 
M

Marc Pelletier

(e-mail address removed) (John Soulis [MSFT]) wrote in
You will need to give these two accounts, IUSR_TONKA and ASPNet,
permissions to the directories they are being denied acces to. You
can do this by right click the folder and going to properties. Then
click the security tab. Then click the add button. Add the account.
It is the account that the aspnet_wp.exe and the inetinfo.exe
processes run under that need to be granted access to the directories
that they are being denied access to.

Thanks for this, John. But I really am feeling more out of the loop all the
time. I am running xp pro and don't have a security tab under properties. I
do have a sharing tab, but it doesn't work the way you describe either, and
all of it is disabled because this directory is used by the operating
system. We are well outside the scope of this newsgroup now, but thanks for
any assistance with this all the same ;-)

cheers

Marc
 
J

John Soulis [MSFT]

This is caused by the "Simple File Sharing' option


To change the option, follow these steps:
Click START then CONTROL PANEL
In Control panel, double-click the FOLDER OPTIONS icon
Under the VIEW tab, scroll to the bottom of the ADVANCED SETTINGS
Remove the check from the option labeled: USE SIMPLE FILE SHARING
Click the OK button to save changes.

** NOTE: This setting cannot be changed on WinXP home systems. To change
NTFS
security settings in XP Home edition you must reboot in Windows safe mode
and log
in as the Administrator.

Thank you,
John Soulis
Microsoft, ASP.NET

This posting is provided "AS IS", with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm
 
M

Marc Pelletier

(e-mail address removed) (John Soulis [MSFT]) wrote in
This is caused by the "Simple File Sharing' option


To change the option, follow these steps:
Click START then CONTROL PANEL
In Control panel, double-click the FOLDER OPTIONS icon
Under the VIEW tab, scroll to the bottom of the ADVANCED SETTINGS
Remove the check from the option labeled: USE SIMPLE FILE SHARING
Click the OK button to save changes.

John,

I'm in. Thank you very much. I gave the aspnet and iusr_Tonka user full
control over the temporary asp.net files directory and that still didn't do
it. So I went back and gave anyone else that seemed to make any sense full
control, and that still didn't do it. Finally I gave everyone full control
and it works. I know that isn't correct, but it works!

I also noticed that aspnet user didn't have write ability on his own
documents and settings directory, so I added that.

Thanks again for the help.

Marc Pelletier
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top