1

Is it possible to produce more than one exe in debug/release folder after we build Windows form solution?

For example I want to produce 2 exes in debug/release folder everytime I build a solution, 1. MyApp.exe 2. MyApp_setup.exe

Thanks

caesardo
  • 348
  • 6
  • 15
  • Suppose you are using Visual Studio, you can make use of [Post Build Events](http://stackoverflow.com/questions/4324347/vs-2010-post-build-copy-files-in-to-multiple-directories-multiple-output-path). – S.C. Feb 06 '15 at 03:55
  • 1
    Create 2 projects within 1 solution. Compile the solution as opposed to compiling the project. Is this the sort of thing that you are attempting to accomplish? – James Shaw Feb 06 '15 at 04:14
  • The problem if i add a project is, each project will have its own folder in the solution folder, which each will have its own debug/release folder.. While what i try to achive is two exes in one debug/release folder, so the twi exes will share the same default settings – caesardo Feb 06 '15 at 05:29
  • The HOWEVER part in the below answer was useful when I had service, winform utilites, and monitor utilties, that differed only by the exe. They shared the same 21 other assemblies in the solution. A single solution was prefered for the build pipeline I was using. – Sql Surfer Mar 16 '17 at 23:13

1 Answers1

6

The \bin\Debug and \bin\Release folders are only defaults and can be changed in your project settings.

enter image description here (Click for larger view)

All you need to do is change it to a relative path to be something both projects can see.

For example, if your folder structure was like

C:\
 Code\
  MyAppSolution\
   MyApp\
   MyApp_Setup\

changing both projects to use ..\CommonBin\Debug\ as their output path would put both exe's in C:\Code\MyAppSolution\CommonBin\Debug\.


However there is a second option also, if you add a reference to the MyApp project to MyApp_Setup when you go to build MyApp_Setup it will put MyApp.exe in the output directory because it considered it a dependency. Just be sure you have Copy Local set to true when you build.

enter image description here

Scott Chamberlain
  • 124,994
  • 33
  • 282
  • 431
  • 1
    The HOWEVER part above is perfect... Multiple .NET EXE Projects in the same solution build to the same single output directory. A useful single sln solution file scenario. – Sql Surfer Mar 16 '17 at 23:08