Two Quick Tips on Web Setup in Visual Studio

How to change the name of the Virtual Directory

By default, when you create a Web Setup Project in Visual Studio, the name of the Virtual Directory it will deploy to is the name that you gave to the Web Setup Project. This can be changed in the property window of the "Web Application Folder" element. At the bottom of the property window, there is a property called VirtualDirectory. If you want the setup to install your application in a subdirectory, you can specify directories using the / character.

WebSetupVirtualDirectory

Simple, but took me some time to find it (I don’t use Web Setup Project very often I have to say).

When I deploy (or when I run the Setup), some of the files are not copied

I had this problem lately. My web project contained a .scv file, and the file was never copied to the IIS virtual directory when using the Deploy… option of Visual Studio, nor was it copied by the Web Setup Project. Actually, this has to do with the Build Action property of the file. If it is set to "None", the file will not be copied. It has to be set to "Content" for the file to be copied as is.

FileBuildAction

When I create a .svc file in my projects, I generally select "Text File" and name it with svc extension. By default, text files have their Build Action set to "None".

Here are two links to articles that contain very useful information on Web Setup Projects:

Comments

One Response to “Two Quick Tips on Web Setup in Visual Studio”

  1. Rchi on September 10th, 2009 07:43

    i am creating webset up for my pro.
    Where i am writing the serverName and database name to the webconfig (servername and database taking from user from textbox(A) but) that is working fine
    BUT.
    i want to make the servername and the database compulsary (i.e if user does not type anything in the textbox) it should pop up message how can i accomplish this

    thanx