Friday, May 22, 2009

Publish a web site to IIS 6.0 by using VS 2008

Yes, it is possible to publish a web site from visual studio 2008 , to IIS 6.0!

I have spent a couple of hours to find a solution, and this seems to be a firewall problem. As I didn't find a solution on google, I suppose it can be useful for other people having publishing problems with visual studio 2008, to read this post.

So, last week I switched from Visual Studio 2005 to Visual Studio 2008. I was trying to publish my web site using the Build\Publish command and the publishing fails (I tried both passive mode and active mode but it seems to be no difference, with both settings I have received the same error message). The error message, I received was:

Unable to add '_TestForm.aspx' to the Web site. Could not find a Web server at 'my ip address' on port 21. Please check to make sure that the Web server name is valid and your proxy settings are set correctly. If you are sure that everything is correct, the Web server may be temporarily out of service.

The same command was working in Visual Studio 2005. Than I was trying to connect to the FTP server using the same user account but with another ftp client, cuteFTP, and it had worked.
Strange, very strange.

After that I was trying to connect to my FTP account using a browser, and I had received a:

425 error saying 'can't open data connection'

I decided to disable the Windows Firewall on the server side (of course just for a short time, just for testing) and without the server firewall I was able to connect to the FTP server by using a browser and I was also able to publish my web site using visual studio 2008.

In this point, I thought some firewall settings on my server were not fine, so I contacted my hosting provider to ask him investigate the problem.

Indeed, it was something in that direction, and a passive FTP was needed for publishing. They had to specify a port range for MS FTP and they made that port range available through the windows firewall, by creating a set of suitable firewall rules. The following article describes the solution for this problem but it is written in german:

http://faq.hosteurope.de/index.php?cpid=13871

Now, I can use visual studio 2008, to publish my web site to IIS 6.0! thank you hosteurope!

No comments:

Post a Comment