I need to create setup project using WIX and also i need to deploy app.config file with my windows application.therefore i have added my app.config as a component in product.wxs as follows :
<Component Id="App.config" Guid="my guid">
<File Source="Source-path" Name="App.config"
Id="myid" KeyPath="yes"/>
</Component>
Once i run msi application installs successfully but app.config xml file becomes unreadable and application fails run due to this problem.how to fix this issue ?. I'm newbie to WIX
When you build your code, the app.config gets renamed to [ApplicationName].exe.config
and will be in your build output directory. This is the file you should harvest as it may have been transformed as part of your build process.
If you are using Votive (wixproj) in your solution then you can reference your application. This will then allow you to use some built in variable names.
<Component Id="[ApplicationName].exe.config" Guid="my guid">
<File Source="var.[ApplicationName].TargetDir\[ApplicationName].exe.config" Name="[ApplicationName].exe.config" Id="myid" KeyPath="yes"/>
</Component>
Note that the []
symbols are only used to identify the code that is specific to your implementation. You should not have these in your wix
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With