Click here to Skip to main content
15,883,827 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I'm adding an MSI file to an application normally deployed to the servers as a One-Click deployment. We have numerous configuration transforms for the app.config and I just changed the existing one to merge production servers into the app section.

Normal (unmerged setting -- default to localhost for services):
HTML
<appSettings file="c:\config\SERVPRO.WorkCenter.FranchiseClient.user.config">
  <add key="placeholder" value="SoThisWillNotGoAway" />
  <add key="ClientSettingsProvider.ServiceUri" value="" />
</appSettings>


The merged version for release:
HTML
<appSettings xdt:Transform="Replace">
  <add key="DataServerHostName" value="prduction server naem"/>
  <add key="AuthenticationServerHostName" value="production server name"/>
  <add key="DataServerPortNumber" value="666"/>
  <add key="AuthenticationServerPortNumber" value="666"/>
  <add key="DisplayLocationInformation" value="True"/>
  <add key="Location" value="Production"/>
</appSettings>


Now I have gone in and verified that a) the msi construction does grab the app config file --and-- b) the app config contains the release data for the production servers.

When I install the application and inspect the files I get the non-merged version of app.config in the installed files instead of the output from the build of the application!!! If gone in and deleted all instances of the build except release and I still get this.

Does the MSI creation construct the app.config => program.exe.config itself and overlooks the transforms??? If so am I now required to tell it manually to get the correct file from the Release folder, rather than use the project output?

Any help is greatly appreciated. I've not found anything on this in my googling.
Posted

I think during MSI creation/compilation the added app.config belongs to the unmerged file path. If this is the case it will be needed to get updated file manually.

honeyashu
 
Share this answer
 
I have since found that the Microsoft Setup project does not expect the app.config file to be transformed at all. As such, even though it is told to take the project output, it creates the app.config itself internally.

As a workaround I had to remove all of the project reference files and manually load up the output in the Release directory. This is acceptable as a workaround since we only want this build on the Release version of the software.

I also found that even selecting just the executable was not acceptable since the setup project did not install all of the files it found as dependent. Thus I had to copy all dependent assemblies and accept the multitude of warnings about duplicate files.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900