DCSIMG
Visual Studio Setup Project Annoyance - Doron's .NET Space

Visual Studio Setup Project Annoyance

Lately I've become uncomfortable with the setup project that comes with Visual Studio 2005. We've been using it to deploy a web application and a windows service, and we hit all sorts of snags.

For instance:

  1. You can only build it inside Visual Studio, so our build server can't produce MSI's for us.
  2. You can't attach .bat files to the installation actions, only .vbs files. I really can't understand why.
  3. CustomAction parameters syntax is not the prettiest thing.

But our latest issue with the setup project had me really puzzled for a while. It involved the deployment of the windows service I mentioned - specifically, its app.config. For some reason, the setup project regarded the actual app.config file as that project's output, instead of the service.exe.config that is generated by MsBuild. In order to deploy that service to different environments we change the .exe.config according to the current build configuration, by using an MsBuild task called XmlMassUpdate. We change the .exe.config file directly, not the app.config, since the latter is usually protected by source control, and therefore marked as read-only. Anyway, it makes a lot of sense for us to change only the output the build produces and not the source.

Thing is, you can't change the setup project view of what the output is (at least we couldn't find a way to do this, even by manually editing the project file), and since it decided that app.config is it, it left us with no choice but to change that source file directly.

I really think the output should simply be regarded as the entire /bin/debug or /bin/release directories, and not just the .exe + app.config files. Go figure.

Published Wednesday, June 04, 2008 8:18 PM by dorony

Comments

# re: Visual Studio Setup Project Annoyance

Yeah that is definitly a pain, I'm in front of the same problem and couldn't resolve it properly. I find a way to overcome it by actually overwrite the app.config file in the project folder BEFORE the build, but as you say, if this file is protected by your source control software, it's not a proper solution...

I don't know what Microsoft has to say about that, is it a bug or a normal behaviour?

Anyway, I'm waiting for any improvments...

Thursday, July 17, 2008 12:58 PM by SD

Leave a Comment

(required) 
(required) 
(optional)
(required) 

Enter the numbers above: