Microsoft Knowledge Base Article
This article contents is Microsoft Copyrighted material.
©2005-©2007 Microsoft Corporation. All rights reserved.
Terms
of Use |
Trademarks
Article ID: 825792 - Last Review: November 14, 2003 - Revision: 1.4
PRB: "Not Running ASP.NET Version 1.1" Error Message When You Try to Open an ASP.NET Web Application Project in Visual Studio .NET 2003
In the
customErrors section of the Web.config file that exists in the root directory
of the
Default Web Site Web site that is set in Microsoft Internet
Information Services (IIS), when you set the
defaultRedirect attribute to an HTML file or to an
Active Server Page (ASP) file and the
Mode attribute to
On, and then you try to open a
new Microsoft ASP.NET Web Application project by using Microsoft Visual Studio .NET 2003,
you receive the following error message:
Visual
Studio .NET has detected that the specified Web server is not running ASP.NET
version 1.1. You will be unable to run ASP.NET Web applications or
services.
Note You receive a similar error message when you try to use the
Copy Project menu option to open a copy of an existing ASP.NET
Web Application project.
When you try to open an ASP.NET Web Application project, the
ASP.NET process accesses a nonexistent file that is named Get_aspx_ver.aspx
to retrieve the ASP.NET version information. If the
defaultRedirect attribute
is not set to an HTML file or to an ASP file, the request for the
Get_aspx_ver.aspx file returns the HTTP 404 error
and the ASP.NET version information. If the
defaultRedirect attribute is
set to an HTML file or to an ASP file, the request for the Get_aspx_ver.aspx
file does not return the ASP.NET version information. Therefore, you receive
the error that is mentioned in the "Symptoms" section of this article.
To work around this problem, follow these steps:
- Create a new text file in Notepad.
- Add the following HTML code to the text file:
<html>
<head>
<title>The resource cannot be found.</title>
<style>
body {font-family:"Verdana";font-weight:normal;font-size: .7em;color:black;}
p {font-family:"Verdana";font-weight:normal;color:black;margin-top: -5px}
b {font-family:"Verdana";font-weight:bold;color:black;margin-top: -5px}
H1 { font-family:"Verdana";font-weight:normal;font-size:18pt;color:red }
H2 { font-family:"Verdana";font-weight:normal;font-size:14pt;color:maroon }
pre {font-family:"Lucida Console";font-size: .9em}
.marker {font-weight: bold; color: black;text-decoration: none;}
.version {color: gray;}
.error {margin-bottom: 10px;}
.expandable { text-decoration:underline; font-weight:bold; color:navy; cursor:hand; }
</style>
</head>
<body bgcolor="white">
<span><H1>Server Error in '/' Application.<hr width=100% size=1 color=silver></H1>
<h2> <i>The resource cannot be found.</i> </h2></span>
<font face="Arial, Helvetica, Geneva, SunSans-Regular, sans-serif ">
<b> Description: </b>HTTP 404. The resource you are looking for (or one of its
dependencies) may have been removed, had its name changed, or is temporarily
unavailable. Review the following URL and make sure that it is spelled correctly.
<br><br>
<b> Requested Url: </b>/appError.aspx<br><br>
</body>
</html>
- Save the text file as
Get_aspx_ver.aspx in the physical folder that is
mapped to the Default Web Site Web site that is set in IIS.
This
behavior is by design.
Steps to Reproduce the Behavior
- Open the Web.config file (if this file exists) from the
physical folder that is mapped to the Default Web Site Web
site in IIS.
Note If the Web.config file does not exist, follow these steps:
- Create a text file in Notepad.
- Add the following XML code to the text file:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.web>
<compilation
defaultLanguage="c#"
debug="true"
/>
<customErrors
mode="RemoteOnly"
/>
<authentication mode="Windows" />
<trace
enabled="false"
requestLimit="10"
pageOutput="false"
traceMode="SortByTime"
localOnly="true"
/>
<sessionState
mode="InProc"
stateConnectionString="tcpip=127.0.0.1:42424"
sqlConnectionString="data source=127.0.0.1;user id=sa;password="
cookieless="false"
timeout="20"
/>
<globalization
requestEncoding="utf-8"
responseEncoding="utf-8"
/>
</system.web>
</configuration>
- Save the text file as Web.config
in the physical folder that mapped to the Default Web Site
Web site in IIS.
- In the customErrors section of the Web.config file, locate the following code:
<customErrors mode="RemoteOnly" />
- Replace the code that you located in step 2 with
the following code:
<customErrors mode="On" defaultRedirect="appError.asp" />
Note The value, appError.asp, of the
defaultRedirect attribute points to an ASP file that exists in the
Default Web Site Web site in IIS. - Create a text file in Notepad.
- Add the following ASP code to the text file:
<%@ Language=VBScript %>
<html>
<head>
</head>
<body>
Test Error Page
</body>
</html>
- Save the text file as appError.asp
in the physical folder that is mapped to the Default Web
Site Web site in IIS.
- Try to open a new ASP.NET Web Application
project by using Visual Studio .NET 2003. You notice the error that is mentioned in
the "Symptoms" section of this article.
For additional information about the customErrors section in the Web.config
file, click the following article number to view the article in the Microsoft Knowledge Base:
306355Â
(http://kbalertz.com/Feedback.aspx?kbNumber=306355/
)
HOW TO: Create Custom Error
Reporting Pages in ASP.NET by Using Visual C# .NET
APPLIES TO
- Microsoft Visual Studio .NET 2003 Enterprise Architect
- Microsoft Visual Studio .NET 2003 Enterprise Developer
- Microsoft Visual Studio .NET 2003 Professional Edition
- Microsoft Visual Studio .NET 2003 Academic Edition
- Microsoft ASP.NET 1.1
| kbmsg kbdeployment kbideproject kbprb KB825792 |
Community Feedback System
Very often, it takes hours to solve a problem. Very often, you've looked high
and low, and have tried a lot of solutions. When you finally found it, chances
are, it was because someone else helped you. Here's your chance to give back.
Use our community feedback tool to let others know what worked for you and what
didn't.
Please also understand that the community feedback system is not warranted to be
correct, it's simply a system that we've built to let people try and help each
other. If something in a feedback response doesn't make sense to you, or you're
not comfortable making changes that the feedback talks about (like registry
edits), please consult a professional.
Thank you for using kbAlertz.com Feedback System.
-- Scott Cate
|
Yousef
- Yousef_abdi7054 NOSPAM-AT-NOSPAM Yahoo.com
|
Reported as Irrelevant
|
| Written:
8/31/2005 5:58 AM |
|
|