I have a main executable that runs based on settings saved in a configuration file. I want to be able to change the settings in the config file through a different executable.
You can build as many assemblies in one solution as you like. Assemblies can result in DLL files or EXE files.
Create a solution (or open an existing solution).
Right-click the root node in Solution Explorer and choose Add → New Project and choose the project type you like to add.
Right-click the project item in Solution Explorer and choose Properties → Build → Output path. Set to the desired directory where to build it to. Repeat this for the other projects.
This way you get the following in Solution Explorer:
The MyCommonCode assembly contains shared code that both EXE files are using like the identifiers of your configuration file, etc.
MyMainApp is the GUI application (Windows Forms, WPF, etc.) for your main application with a project-reference to the MyComonCode project.
MyConfigApp is a GUI application for editing the configuration values with a project reference to MyCommonCode project.
After building your solution you get the following binaries: MyCommonCode.dll
, MyMainApp.exe
, and MyConfigApp.exe
.
Update based on the comment:
One compile-run can build only one binary (DLL or EXE) per project. You can do something like the answer above: move most of the code in a common/core DLL and make two thin projects for the two EXE files which only "configure and use" the central common/core DLL file.
You can build different EXE files based on the same project using compiler defines. You can even define your own defines. But per compile-run you can only build one binary (DLL, EXE) per project - one or the other, but not both.
The idea of a configuration file is that you don't need to build multiple executable files. ;-)
You could use the Configuration Manager, to create a new Solution configuration and change the output directory for that configuration.