Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using a c# Setup project, how do I get a config file (nlog.config) into the msi for the Setup project?

The nlog.config is being put into the bin/Debug for my project. In the setup project I have primary output of project a and content files of project a to be included in the Application folder. nlog.config, however is not making to the msi. Any ideas?

like image 203
Mike Roosa Avatar asked Dec 08 '25 12:12

Mike Roosa


2 Answers

Adding the file manually means that you will have to redo the step if you change the file in the source.

Instead, make sure that the build action of your NLog.Config is set to "Content"

Then, add Project Output Group of type "Content Files" in your setup project:

Adding Content Files to Setup Project.

like image 103
Zaid Masud Avatar answered Dec 10 '25 01:12

Zaid Masud


I have found a solution to this. Right click on the setup project and choose Add then File. Just select the nlog.config file from the bin directory where it is being placed after a compile and it works perfectly.

like image 34
Mike Roosa Avatar answered Dec 10 '25 00:12

Mike Roosa