How to move file system Web site to IIS
When you are using Visual Web Developer or Visual Studio, you may begin working on a new Web site as a file system based Web running it on the Development Web Server. However, at certain point you may want to move to IIS for whatever reason: IIS has better performance, some may want to add classic ASP page, some may want to publish the Web directly from the machine, whatever. How do you move your Web site to IIS?
Thanks PhilM99 who summarized steps in the thread in ASP.NET forums:
- Close the VS2005 project.
- Using IIS manager, created a virtual directory pointing to the folder containing all the pages.
- In VS2005, Click on File..Open Web Site.
- Select the tab Local IIS.
- Find the virtual directory you just created, select it and click Open.
Now you are running your Web site on IIS.
Comments
- Anonymous
March 30, 2006
I was trying to do this today with a project, and I ran into a problem. The Open Web Site dialog does not include my newly created virtual directory in the list.
One unusual thing that I did was I created the virtual directory using a Windows Script via the ADSI API. The virtual directory works fine, I can access the site, I can view it and change settings on it in the IIS manager.
But Visual Studio 2005 will not show it in the dialog, even after closing and reopening, or stopping and restarting both IIS and DEVENV.
Any thoughts? I looked into the metabase with MetaEdit thinking there was some subtle attribute that was set wrong, can't find one.
What criteria does the "Open Web Site" dialog use to filter the list of sites it shows? - Anonymous
April 13, 2006
Are you by any chance running Win64 ? - Anonymous
April 17, 2006
No, I was not running Win64. I figured it out, though.
For some reason, when you create a virtual directory with ADSI (at least in IIS 5.0), it does not serialize the "KeyType" property of the virtual directory object to the metabase. Without this field filled in, any later caller who tries to work with that virtual directory using ADSI will find that it hands them back the wrong type of object (an IIsWebDirectory instead of a IIsWebVirtualDir).
The workaround is simple and obvious: when creating an IIsWebVirtualDir, be sure to explicitly set the KeyType property before saving the object to the metabase.
Something like this:
var VDirRoot = GetObject(iisRoot);
NewVDir = VDirRoot.Create("IIsWebVirtualDir", vdirname);
NewVDir.Path = physicalpath;
NewVDir.KeyType = "IIsWebVirtualDir";
Once you have made sure that "KeyType" is filled in properly in this way, then Visual Studio will see your created virtual directory in the chooser. - Anonymous
May 29, 2009
PingBack from http://paidsurveyshub.info/story.php?title=mikhail-arkhipov-msft-s-weblog-how-to-move-file-system-web-site-to-iis