Pages

Thursday, July 14, 2005

VS.NET Copy Project

Here is a solution for an issue I run into today.
Issue:
In VS.NET 2003 I tried to use the "Copy Project" feature to copy (deploy) the files required to run a web application to another web server. Nevertheless I got an error saying (more or less): ..."error occurred while copying the project" ... "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".
Context:
I was evaluating Community Server 1.1 and I had a full source installation on my Windows XP workstation altering bits and pieces to customize the application. I had previously installed a binary installation of the same product to my Windows 2003 Web Server.
Reactions:
First I made sure ASP.NET was running on my remote web server. Just to be on the safe side I even run aspnet_regiis -i, but it did not fix the problem. I had never encountered an issue like that so I googled for it. I found similar problems but all had solutions I had already tried with no luck. So mine had to be different.
Solution:
I figured out what was wrong when I tried to find out what my VS.NET was doing on my workstation to determine the ASP.NET version on my remote web server. It turned out that VS.NET did an HTTP request to:
http://MyRemoteWebSrver/MyApplication/get_aspx_ver.aspx
This file (an actual ASPX page named get_aspx_ver.aspx) does not exist so the server returns the well known "resource not found" error page. But ASP.NET in that default error page, returns the .NET Framework version information which is in turn used by VS.NET to verify version information. Silly but true!
Now! The problem was that Community Server by default had defined Custom Error Pages. So suddenly it occurred to me and here is what I did to solve the problem:
I went to my remote web server, and added the following lines to the web.config of my application:
Solved!
P.S: I also added the same lines to the web.config in my workstation since I was about to overwrite the web.config on the server. Remember I was originally trying to copy the files needed to run the project from my workstation to the web server using Copy Project feature of VS.NET.