Error on publishing ASP.Net website from IIS
December 14th, 2009 trisnokAfter teaching today, I found some errors while my students want to publish their ASP.Net website from IIS (Internet Information Service).
First, if you don’t know how to add your website to IIS, let me tell you how to do it.
1. Go to Control Panel->Administrative Tools->Internet Information Service
2. Right click on Default Web Site->New->Virtual Directory
3. Click Next->[Type your folder name or whatever/alias]->[Choose directory where you put your website's folder]->Ok
After you those steps, try to browse you website by right click on your folder name and choose Browse.
If your website shows on the right column, it means you can open your website from your browser by typing http://localhost/[your folder name/alias]. But if you find some error, maybe you can try to solve it by using these errors collection and the way to solve it.
1. You Are Not Authorized to View This Page
Answer
First, you can right click on your folder name or alias then choose All Tasks->Permission Wizard. Just click Next till it finish. Try again to browse your alias.
Second,
- Start Internet Services Manager, or open the Microsoft Management Console (MMC) that contains the IIS snap-in.
- Expand * server name, where server name is the name of the server.
- Right-click the virtual server or virtual directory (for example, Default Web Site) that you want to configure, and then click Properties.
- Click the Directory Security tab.
- Under Anonymous access and authentication control, click Edit.
- Click to select the Basic authentication (password is sent in clear text) check box.
- When you receive the Are you sure you want to continue? message, click Yes.
- Click to clear the Integrated Windows authentication check box.
- Click to clear the Anonymous access check box.
- Click OK, and then click OK.
- Quit the IIS snap-in
taken from this
2. The current identity (LKIS-19\ASPNET) does not have write access to ‘C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files’.
Answer
ASP.Net applications run under a worker process, and this in turn must be run under a user account. For security reasons, Microsoft won’t let this run as the SYSTEM account, because it has full control of your system. Instead, it runs as a user called ASPNET. LKIS-19 is apparantly your computer name. And what the error is saying is that this ASPNET user on your computer does not have access to write to the folder C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\. This is where ASP.Net generates its temporary files (mostly assembly DLL files), and the worker process user account must have write access to this folder for ASP.Net to launch.
So, log onto your computer as Administrator and open Windows Explorer. Browse to C:\WINDOWS\Microsoft.Net\Framework\v2.0.50727\. Right-click the “Temporary ASP.NET Files” folder and pick Properties. Go to the Security tab, and click Add. Type in [Compute Name]\ASPNET and click OK. Then find the ASPNET user in the list, and Grant it Full Control. Click OK. Then, go to Control Panel -> Administrative Tools -> Services, find IIS Admin Service in the list, right-click it and pick Restart.
taken from here
3. Failed to access IIS metabase
Answer
If this error comes, just restart you Visual Studio from
All Program->Microsoft Visual Studio 2005->Visual Studio Tools->Visual Studio 2005 Command Prompt
After that type : aspnet_regiis -i
Wait until the process finish. After that you can browse your application again.
4. Still not working??????
Answer
Okay, if still not working, right click on your alias or folder name, choose properties, please check them.
1. Virtual Tab
- Local Path: check Read, Log visits, Index this resources
- Execute Permission : Script only
- Application Protection : Medium (Pooled)
2. Documents Tab
- Check Enable Default Document
- If you don’t find file Default.aspx, just add it.
3. ASP.NET Tab
- ASP.NET version : Choose your .net version, after that click OK
Then, try to browse your alias or folder name again, if any error show up again (usually about metabase) try to solve it by following the previous steps.
Okay, thanks for visiting and if you find another way to solve those errors you can share them here. ![]()
Tags: Error in IIS, Error on ASP.NET website, Error on publishing ASP.Net website from IIS, Failed to access IIS metabase, Internet Information Service Error, The current identity (LKIS-19\ASPNET) does not have write access to 'C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files'., You Are Not Authorized to View This Page
