ClickOnce - How to add config file to list of files that get published

R

roybrew

This (seemingly) simple item has escaped me after pouring over tons of
posts about ClickOnce. How does one add a config file
(myapp.exe.config) to the list of executables and dlls that get
published with a ClickOnce application? All I want to do has have a
standard config file get dropped down in the folder where the
application gets run from. I don't want to have to edit the manifest
every time I publish. When you go to the publish tab in the project
settings and click on the "Application Files" button, it seems to find
the EXE, and DLLs correctly. How can I make sure that my config file
gets added to that list as well? TIA

Roy
 
A

Andy

Did you try clicking the Applications Files button? Normally though if
your have an App.config in your solution, it will automatically pick
up the config file for clickonce.

HTH
Andy
 
R

roybrew

Uh, yeah. I clicked the button. That's how I found my exe and dlls
listed. Does the config file actually need to be named "App.config" or
can it be called MyApp.exe.config?

roy
 
A

Andy

In your project it should be called App.Config. When you build, VS
will automatically rename that file to whatever the configuration
should be called after it copies the file to the bin folder.

HTH
Andy
 
R

roybrew

Thanks Andy. I was also able to add the config file as it was named
(i.e. myaapp.exe.config) and give it a build action of "Content" and
make sure it was copied to the output directory. This also added it to
the list of Application files. But your way is cleaner and appears to
be the standard way, so I'll use that. Thanks again for the help.

roy
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top