Creating and opening ASP.NET projects in Visual Studio .NET
ASP.NET Support Voice columnCreating and opening ASP.NET projects in Visual Studio .NETTo customize this column to your needs, we want to invite you to submit your ideas about topics that interest you and issues that you want to see addressed in future Knowledge Base articles and Support Voice columns. You can submit your ideas and feedback using the Ask For It (http://support.microsoft.com/common/survey.aspx?scid=sw;en;1176&p0=&p1=&p2=&p3=&p4=) form. There's also a link to the form at the bottom of this column.On This PageIntroductionWelcome to the ASP.NET Support Voice column! My name is
Jerry Orman. I have been with Microsoft over 5 years, and have spent most of my
time focused on Web-related technologies such as Microsoft FrontPage and the
new Microsoft SharePoint technologies. I have spent the last year working with
Microsoft ASP.NET as a support engineer. This month in the Support Voice
column, I am going to describe creating and opening ASP.NET projects in
Microsoft Visual Studio .NET. While troubleshooting an issue in which I am unable to open or create ASP.NET-based projects, I've found that it is very important to understand what Visual Studio .NET is doing in the background to help isolate the issue. As you'll see below, this process has multiple steps and is very dependent on Microsoft Internet Information Services (IIS) functioning correctly on the back end. I will include the error messages and dialog boxes you will see along the way as well as recommended steps to narrow down the problem. File path versus FrontPage Server ExtensionsIn Microsoft Visual Studio .NET 2003, there are two methods for creating and opening Web sites. One method uses a file path to copy files, and the other method uses Microsoft FrontPage Server Extensions. Each method has pros and cons. Below is a table outlining the differences.FrontPage Server Extensions
Changing the method used to create projectsBy default, Visual Studio .NET uses the file share method. If you want to always use the FrontPage Server Extensions method by default, you can change this setting by following the steps below:
Creating an ASP.NET projectWhen you create a project, the behavior is similar regardless of the method you use. In general, the following will occur:
A folder is created and marked as an applicationWhen using the file share method, a folder is created at the UNC path \\server\wwwroot$\application. If you are working locally, the IDE will get the local path for the Web site from the IIS metabase and uses the local path instead of the UNC path. The folder is then marked as an application in IIS by using ADSI. This process requires you to be an administrator on the computer you are creating the project on. If you don't have access to the share or the share does not exist, you will get the following message:The version of the framework is verifiedOnce the IDE creates the folder, it verifies that the correct version of the framework is configured. This is done by sending a request for the get_aspx_ver.aspx file. The path of the request will be applicationPath/get_aspx_ver.aspx. This file doesn't exist and the IDE is expecting the ASP.NET 404 message to be returned. The IDE uses this error page to get the version number listed at the bottom. In this case the version is 1.1.4322.2300. This is the version for the Microsoft .NET Framework 1.1, which is included with Microsoft Windows Server 2003 Service Pack 1 (SP1).Check the IIS Mappings:
%windir%\Microsoft.NET\Framework\v1.1.4322 If there is an error getting to the page, you will get an error
stating an HTTP exception similar to the following:Tip A 403 response in this scenario is typically caused by Execute Permissions being set to None or Read being unchecked.
The vs-####_tmp.htm fileOnce the folder is created and the version of the framework is confirmed, the IDE copies an .htm file to the folder. The file is then browsed using the URL used to create the site. This is done to ensure that the folder the IDE is using can be browsed using the URL. The file will have a name similar to vs11062107329733631_tmp.htm. The number will always be different. When the IDE requests the file, it has to be the EXACT same file as was copied into the directory. If something intercepts the request and modifies the output or the page is not returned, you will see the following dialog box. The same dialog box is returned whether you are using FrontPage Server Extensions or file share. The only difference is the option that is selected.16:21:25 127.0.0.1 GET /WebApplication1/vs11062107329733631_tmp.htm 404 The 404 is a File Not Found response code. This code indicates that once the IDE made the request using the URL, the file didn't exist. Typically, this problem is due to the share path not pointing to the location that the IIS Web server is using to serve content. The next step is to copy a test HTML file into the share listed in the error and browse the file using the URL. If this fails, you need to investigate the permissions on the share and check the properties for your IIS Web site that maps to the URL to make sure that the local path matches the folder that is shared.Check the file path IIS is using:
Copy template files into the site folderOnce all the above checks are completed, the template files are copied into the folder and displayed in Solution Explorer. If you are using FrontPage Server Extensions to create the site, you will see the following dialog box while this occurs:Troubleshooting creating ASP.NET applicationsNow that we can see how dependent this process is on IIS and the configuration being a specific way, the first place you'll want to check is the IIS logs. Along with the above dialog boxes and information, this will help you to determine which step isn't working. The IIS logs are in the following location:%windir%\system32\logfiles\w3svc# Note # is the IIS Instance number of the Web
site.Tip You can also go to Start, click Run, and type LogFiles to get to the default log file directory. You can get the path by checking the IIS Properties:
#Software: Microsoft Internet Information Services 6.0 #Version: 1.0 #Date: 2005-08-30 20:35:33 #Fields: date time s-ip cs-method cs-uri-stem cs-uri-query s-port cs-username c-ip cs(User-Agent) sc-status sc-substatus sc-win32-status The GET request for get_aspx_ver.aspx – notice the response is a 404 File Not Found. This is the expected response. 2005-08-30 20:35:33 65.53.73.163 GET /supportvoice3/get_aspx_ver.aspx - 80 - 65.53.75.132 Microsoft-Visual-Studio.NET/7.10.3077 404 0 0 Here is the GET request for the vs###_tmp.htm file. The expected response for this is a 200. 2005-08-30 20:35:33 65.53.73.163 GET /supportvoice3/vs158849317529732258_tmp.htm - 80 - 65.53.75.132 Microsoft-Visual-Studio.NET/7.10.3077 200 0 0 These are requests for FrontPage Server Extensions files. Even though you specified file share mode, if the FrontPage Server Extensions are on the site, the IDE will still look for them and try to use them if possible. On this site, the FrontPage Server Extensions are not configured, so all these requests return 404 messages. You won't see anything related to the actual project files because they are all copied over SMB, which is not handled by IIS. 2005-08-30 20:35:33 65.53.73.163 GET /_vti_inf.html - 80 - 65.53.75.132 Mozilla/2.0+(compatible;+MS+FrontPage+4.0) 404 0 2 2005-08-30 20:35:33 65.53.73.163 POST /supportvoice3/_vti_bin/shtml.exe/_vti_rpc - 80 - 65.53.75.132 MSFrontPage/4.0 404 0 3 2005-08-30 20:35:33 65.53.73.163 GET /_vti_inf.html - 80 - 65.53.75.132 Mozilla/2.0+(compatible;+MS+FrontPage+4.0) 404 0 2 2005-08-30 20:35:33 65.53.73.163 POST /_vti_bin/shtml.exe/_vti_rpc - 80 - 65.53.75.132 MSFrontPage/4.0 404 0 3 2005-08-30 20:35:33 65.53.73.163 GET /_vti_inf.html - 80 - 65.53.75.132 Mozilla/2.0+(compatible;+MS+FrontPage+4.0) 404 0 2 2005-08-30 20:35:33 65.53.73.163 POST /_vti_bin/shtml.exe/_vti_rpc - 80 - 65.53.75.132 MSFrontPage/4.0 404 0 3 2005-08-30 20:35:33 65.53.73.163 GET /_vti_inf.html - 80 - 65.53.75.132 Mozilla/2.0+(compatible;+MS+FrontPage+4.0) 404 0 2 2005-08-30 20:35:33 65.53.73.163 POST /_vti_bin/shtml.exe/_vti_rpc - 80 - 65.53.75.132 MSFrontPage/4.0 404 0 3 2005-08-30 20:35:33 65.53.73.163 GET /supportvoice3/get_aspx_ver.aspx - 80 - 65.53.75.132 Microsoft-Visual-Studio.NET/7.10.3077 404 0 0Now that we've seen what an IIS log looks like for a successful project creation using the file share mode, let's take a look at a log using FrontPage Server Extensions to create the project. I've again added some comments to help out: #Software: Microsoft Internet Information Services 6.0 #Version: 1.0 #Date: 2005-08-30 20:42:40 #Fields: date time s-ip cs-method cs-uri-stem cs-uri-query s-port cs-username c-ip cs(User-Agent) sc-status sc-substatus sc-win32-status The GET request for get_aspx_ver.aspx – notice the response is a 404 File Not Found. This is the expected response. 2005-08-30 20:42:40 65.53.73.163 GET /supportvoice/get_aspx_ver.aspx - 9999 - 65.53.75.132 Microsoft-Visual-Studio.NET/7.10.3077 404 0 0 Here is the GET request for the vs###_tmp.htm file. The expected response for this is a 200. 2005-08-30 20:42:52 65.53.73.163 GET /supportvoice/vs168727587929732259_tmp.htm - 9999 - 65.53.75.132 Microsoft-Visual-Studio.NET/7.10.3077 200 0 0 You'll now see requests looking for the author.dll file. This first request looks for the file in a _vti_bin folder inside the application folder. This is for backward compatibility. The file was moved into the _vti_bin folder in the root of the Web site as of the 2000 version of the FrontPage Server Extensions. 2005-08-30 20:42:52 65.53.73.163 POST /supportvoice/_vti_bin/_vti_aut/author.dll - 9999 - 65.53.75.132 MSFrontPage/4.0 404 0 3 Now the IDE is looking in the _vti_bin folder in the root of the Web site. The IDE finds the shtml.dll file (it returned a 200), so the IDE starts sending POST requests to the author.dll file to copy the files for the ASP.NET project to the Web site. You can run a network monitor trace and look in the body of the POST to author.dll to see the FrontPage RPC calls that are made. 2005-08-30 20:42:52 65.53.73.163 POST /_vti_bin/shtml.dll/_vti_rpc - 9999 - 65.53.75.132 MSFrontPage/4.0 200 0 0 2005-08-30 20:42:52 65.53.73.163 POST /_vti_bin/_vti_aut/author.dll - 9999 - 65.53.75.132 MSFrontPage/4.0 200 5 0 2005-08-30 20:42:52 65.53.73.163 POST /_vti_bin/_vti_aut/author.dll - 9999 - 65.53.75.132 MSFrontPage/4.0 401 1 0 2005-08-30 20:42:54 65.53.73.163 POST /_vti_bin/_vti_aut/author.dll - 9999 DOMAIN\user 65.53.75.132 MSFrontPage/4.0 200 0 0 2005-08-30 20:42:54 65.53.73.163 POST /_vti_bin/_vti_adm/admin.dll - 9999 - 65.53.75.132 MSFrontPage/4.0 200 5 0 2005-08-30 20:42:54 65.53.73.163 POST /_vti_bin/_vti_adm/admin.dll - 9999 - 65.53.75.132 MSFrontPage/4.0 401 1 0 Opening existing projectsWhen opening projects in the Visual Studio .NET IDE, you get two options on the File menu, Open Project and Open Project From Web. If you want to open the project using the file share method, you use Open Project. If you want to use FrontPage Server Extensions, you use Open Project From Web.Open ProjectWhen you select Open Project, the Open Project dialog box opens and you navigate to the .vbproj or .csproj file associated with your ASP.NET application. When you open the project file, the IDE uses the .webinfo file located in the same folder to match the file path you selected with the URL listed in the .webinfo file.The .webinfo file contains the following information pointing to the project file by using a URL: The URL listed is the URL specified when the project was first created.
The validation done here is the same as that used to create a new project.
Visual Studio .NET copies a file to the file path you used to open the project
named vs###_tmp.htm and then browses the file using the URL in the .webinfo
file. In this case, if the request to the .htm file fails, you will get the
following message: Unable to open Web project
'SupportVoice'. The file path
'\\server\share\supportvoice'
does not correspond to the URL
'http://server/wrongpath'. The two need to map to
the same server location. HTTP Error 404: Not Found Notice the URL is /wrongpath and not /supportvoice. This indicates the .webinfo has the incorrect URL.The IIS log will show the following entry: 2005-08-30 20:48:12 65.53.73.163 GET /wrongpath/vs59855858329732260_tmp.htm - 9999 - 65.53.75.132 Microsoft-Visual-Studio.NET/7.10.3077 404 0 3 If you need to troubleshoot opening a project using file share, the following IIS log shows what the process looks like when it works. I've again added some comments to help you out:#Software: Microsoft Internet Information Services 6.0 #Version: 1.0 #Date: 2005-08-30 20:33:49 #Fields: date time s-ip cs-method cs-uri-stem cs-uri-query s-port cs-username c-ip cs(User-Agent) sc-status sc-substatus sc-win32-status GET for the vs###_tmp.htm. The response is a 200, which is the correct response. If you have any other response, you need to check the .webinfo file and make sure that the file path you used for the project file matches the URL in the .webinfo file. 2005-08-30 20:33:49 65.53.73.163 GET /SupportVoice/vs51193067529732258_tmp.htm - 80 - 65.53.75.132 Microsoft-Visual-Studio.NET/7.10.3077 200 0 0 Requests looking for FrontPage Server Extensions to see if they are configured. Notice that these are all 404 File Not Found in this case. 2005-08-30 20:33:49 65.53.73.163 GET /_vti_inf.html - 80 - 65.53.75.132 Mozilla/2.0+(compatible;+MS+FrontPage+4.0) 404 0 2 2005-08-30 20:33:49 65.53.73.163 POST /SupportVoice/_vti_bin/shtml.exe/_vti_rpc - 80 - 65.53.75.132 MSFrontPage/4.0 404 0 3 2005-08-30 20:33:49 65.53.73.163 GET /_vti_inf.html - 80 - 65.53.75.132 Mozilla/2.0+(compatible;+MS+FrontPage+4.0) 404 0 2 2005-08-30 20:33:49 65.53.73.163 POST /_vti_bin/shtml.exe/_vti_rpc - 80 - 65.53.75.132 MSFrontPage/4.0 404 0 3 GET request for the get_aspx_ver.aspx page. The expected response is a 404. 2005-08-30 20:33:52 65.53.73.163 GET /SupportVoice/get_aspx_ver.aspx - 80 - 65.53.75.132 Microsoft-Visual-Studio.NET/7.10.3077 404 0 0 Open Project From WebIf you select Open Project From Web, you are using FrontPage Server Extensions. This method does not use the file path and is done completely over HTTP. From the beginning, you'll notice that you are asked for the URL of the site instead of the file path of the project file. This method also does not use the .webinfo file because the IDE does not need to validate that the file share is the same as the Web site.304133 (http://support.microsoft.com/kb/304133/) Errors appear if you use an Office XP program to save content
The following IIS log shows the IDE opening a
project by using FrontPage Server Extensions. Notice there is not a request for
the get_aspx_ver.aspx file or for the vs###_tmp.htm file. All the requests are
being sent through the DLLs in the _vti_bin folder.#Software: Microsoft Internet Information Services 6.0 #Version: 1.0 #Date: 2005-08-30 20:44:41 #Fields: date time s-ip cs-method cs-uri-stem cs-uri-query s-port cs-username c-ip cs(User-Agent) sc-status sc-substatus sc-win32-status 2005-08-30 20:44:41 65.53.73.163 OPTIONS / - 9999 - 65.53.75.132 Microsoft+Data+Access+Internet+Publishing+Provider+Protocol+Discovery 200 0 0 2005-08-30 20:44:41 65.53.73.163 GET /_vti_inf.html - 9999 - 65.53.75.132 Mozilla/4.0+(compatible;+MS+FrontPage+6.0) 200 0 0 2005-08-30 20:44:41 65.53.73.163 POST /_vti_bin/shtml.dll/_vti_rpc - 9999 - 65.53.75.132 MSFrontPage/6.0 200 0 0 2005-08-30 20:44:41 65.53.73.163 POST /_vti_bin/_vti_aut/author.dll - 9999 - 65.53.75.132 MSFrontPage/6.0 200 5 0 2005-08-30 20:44:41 65.53.73.163 POST /_vti_bin/_vti_aut/author.dll - 9999 - 65.53.75.132 MSFrontPage/6.0 401 1 0 2005-08-30 20:44:42 65.53.73.163 POST /_vti_bin/_vti_aut/author.dll - 9999 DOMAIN\user 65.53.75.132 MSFrontPage/6.0 200 0 0 2005-08-30 20:44:42 65.53.73.163 OPTIONS / - 9999 - 65.53.75.132 Microsoft+Data+Access+Internet+Publishing+Provider+Protocol+Discovery 200 0 0 2005-08-30 20:44:42 65.53.73.163 POST /_vti_bin/_vti_aut/author.dll - 9999 - 65.53.75.132 MSFrontPage/6.0 401 1 0 2005-08-30 20:44:42 65.53.73.163 POST /_vti_bin/_vti_aut/author.dll - 9999 DOMAIN\user 65.53.75.132 MSFrontPage/6.0 200 0 0 2005-08-30 20:44:46 65.53.73.163 OPTIONS / - 9999 - 65.53.75.132 Microsoft+Data+Access+Internet+Publishing+Provider+Protocol+Discovery 200 0 0 2005-08-30 20:44:46 65.53.73.163 OPTIONS /supportvoice - 9999 - 65.53.75.132 Microsoft+Data+Access+Internet+Publishing+Provider+Protocol+Discovery 200 0 0 2005-08-30 20:44:46 65.53.73.163 POST /supportvoice/_vti_bin/_vti_aut/author.dll - 9999 - 65.53.75.132 MSFrontPage/6.0 200 5 0 2005-08-30 20:44:46 65.53.73.163 POST /supportvoice/_vti_bin/_vti_aut/author.dll - 9999 - 65.53.75.132 MSFrontPage/6.0 401 1 0 2005-08-30 20:44:46 65.53.73.163 POST /supportvoice/_vti_bin/_vti_aut/author.dll - 9999 DOMAIN\user 65.53.75.132 MSFrontPage/6.0 200 0 0 2005-08-30 20:44:46 65.53.73.163 POST /supportvoice/_vti_bin/_vti_aut/author.dll - 9999 - 65.53.75.132 MSFrontPage/6.0 401 1 0 2005-08-30 20:44:46 65.53.73.163 POST /supportvoice/_vti_bin/_vti_aut/author.dll - 9999 DOMAIN\user 65.53.75.132 MSFrontPage/6.0 200 0 0 Does any of this change for Visual Studio .NET 2005?There are some changes to how Microsoft Visual Studio .NET 2005 will interact with Web projects. The main difference is that there is not a project file and there is not a dependency on IIS. Developers will be able to create Web applications on their hard disk. When the developers browse or debug the applications from the IDE, a small Web server is started on a unique port to serve the requests.The following link contains a lot of information about Web projects in the upcoming Visual Studio .NET 2005 release:
http://weblogs.asp.net/scottgu/archive/2005/08/21/423201.aspx (http://weblogs.asp.net/scottgu/archive/2005/08/21/423201.aspx) As always, feel free to submit ideas on topics you want
addressed in future columns or in the Knowledge Base using the
Ask For It (http://support.microsoft.com/common/survey.aspx?scid=sw;en;1176&p0=&p1=&p2=&p3=&p4=) form.
| Article Translations
|

Back to the top
