Last post Sep 21, 2010 05:38 AM by kakoskin
Aug 27, 2010 11:35 PM|gbtji|LINK
I'm using VS2010 and have a web application project and a web setup project.
When building my solution using VS2010, how do I get my web.config file to be transformed so that it can be packaged in the MSI by my web setup project?
At the moment my web setup project includes the "Content Files" which includes the non-transformed web.config.
Aug 28, 2010 02:09 AM|RaoYasir|LINK
Just follow the instruction given in the following tutorial. hope it will help you.
Aug 28, 2010 02:50 AM|gbtji|LINK
Thanks for replying Yasir but I don't think you understood my question. I'm not talking about the IIS web deploy tool. I understand how this works and the zip that's generated includes the transformed web.config.
What I'm talking about is a web setup project that generates an MSI. When you select to include the "Content Files" it picks up the non-transformed web.config.
I want to know how my web setup project can pick up the transformed web.config instead.
It's very simply to re-create. In VS2010 create a web application project. Then create a web setup project and include the content files and output of the web application project. Build the solution and run the generated MSI. The web.config that's laid down
by the setup is the non-transformed version. I want to know how to get it to lay down the transformed web.config. It's seems odd that it just doesn't do this by default.
Aug 28, 2010 05:49 AM|RaoYasir|LINK
what i got from you is that, you have a web application and you want to install/deploy it on your domain. For this you have to do the following
after building release you have to install it on your local pc and then copy all files from there to your hosting domain.
you have to change your config file according to them. this may help you.
Aug 29, 2010 03:13 AM|gbtji|LINK
Does anyone use web setup projects in VS2010?
If so, how do you get the web setup project to pick up the transformed web.config?
Sep 21, 2010 02:23 AM|kakoskin|LINK
I'm having the very same problem. It's a pity that there is no built-in support!!
It shouldn't be rocket science to include the transformed web.config to msi package based on selected configuration.
One problem is that whenever the project is built it does not build the transformed web.configs unless you manually do so.
I would be very interested to have any solution (or hack) to this problem.
msi web config transformation not working web setup project
Sep 21, 2010 05:38 AM|kakoskin|LINK
I think I found solution how to use web.config transformations and web setup projects (.msi files):
How to use web.config transformations with web setup projects:
What is needed before applying this:
- web application project
- web setup project linked to web application project
1. Create needed configurations (Dev,QA,Production etc.) and associated web config transformations.
2. Use notepad or other text editor and include following in your web application project file (.csproj file) before tag <ProjectExtensions> (near the end of the project file):
<TransformXml Source="Web.config" Transform="$(ProjectConfigTransformFileName)" Destination="Web.Transformed.config" />
Do not include Web.Transformed.config in the web application project - if you do visual studio will alert you about the changes after every build which is pretty annoying.
3. In the web setup project:
select Content files - > Exclude Filter and add Web.config (and all other Web.*.config files containing transformation rules).
4. In the web setup project:
select file system editor icon -> web application folder -> Add File
and select Web.Transformed.config in the root of your web application project folder.
5. In the same screen: right click Web.Transformed.config and rename it to Web.config
Now you are able to generate .msi files with selected configuration and root web.config file is transformed!
Please note that this does not affect web.config files in the sub folders.