Monday, April 14, 2008

Visual Studio 2008 publishing to Windows Server 2008 via FTP does not work in active/passive mode

I'm in the process of creating a 5 year plan, and I identified the need to have a web site and blog as part of this.

So the first step was to get a hosting service with Server 2008 (as I did not want to start creating stuff based on older technologies) and to create a mini-web site using Visual Studio 2008. All pretty simple stuff.

However pretty quickly I ran into a problem when trying to publish - namely I could not get FTP publishing to work. Obviously it must be the new box and the firewall settings - checked that, nope I can happily FTP and put files on the server from a command prompt.

So I started looking at the usual suspects and searching the web for the error:
"An error occured trying to enumerate the contents of folder"
this was a bit of a wierd error, maybe I had not given list permissions on the file system? nope once again I could list the diretories in a command prompt FTP session.

After a bit of searching I found that someone else had the same problem:
https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=321202

which had been closed as apparently it was by design. WTF, this was a bit wierd - surely specifing Active or Passive should have some effect - from looking at the FTP log on the server it appears as if VS2008 ignores this setting either way.

In the end the work around was to remove the FTP server (the one you get out of the box is actually the old IIS6 FTP server, which requires the yucky metabase) an install the IIS7 FTP server that did not make RTM in time - FTP7:
http://learn.iis.net/page.aspx/309/configuring-ftp-firewall-settings/

and then 2008 specific firewall steps
http://blogs.iis.net/jaroslad/archive/2007/09/29/windows-firewall-setup-for-microsoft-ftp-publishing-service-for-iis-7-0.aspx

after which it all worked fine - now I can get back to actually writing code rather than fighting firewalls and errors that don't actually help you with the problem...

No comments: