2

Is there a proper place in a Visual Studio solution for .exes required by your solution. For example I'm working on a tool now that needs VHDCreate.exe, ISOCreate.exe, OSClone.exe and other exes. What is the right way to include them in a solution? I've inherited a solution where they are just stuck inside a folder inside the business layer project of the solution.

I'm using Visual Studio 2010.

Moayad Mardini
  • 7,271
  • 5
  • 41
  • 58
BuddyJoe
  • 69,735
  • 114
  • 291
  • 466

3 Answers3

2

I would suggest having a nicely organized tools folder at the level of the solution. Then you can use a solution folder to organize it separate from the rest of the projects.

Daniel A. White
  • 187,200
  • 47
  • 362
  • 445
0

This is with a native .dll but the concept is the same.

  • Add existing item to solution and pick any folder where binaries exist:

Add Existing

  • Select add as link from whatever folder outside solution you keep the binaries

Add as Link

  • In the solution explorer set it as Copy if newer.

Solution Explorer

  • The .exe or .dll will be copied to the build output folder if needed.

Output Folder

  • When the original .exe gets updated the build will pull the newer one in the output folder.
John Alexiou
  • 28,472
  • 11
  • 77
  • 133
0

You might want to read Mike Roberts series, How to Set Up a .Net Development Tree. The way Visual Studio does it by default is essentially broken, as far as I'm concerned.

Single *.pdf: How to Set Up a .Net Development Tree

Fundamentally, your directory structure should look like this:

  • Meta/Development Root
    Usually mapped to root of source control system.
    • Solution
      One directory, contain your entire solution. Should be named to match the solution.
      • Solution.sln
        The solution file itself.
      • nant.build
        The nAnt build file for the solution.
      • lib
        The lib directory contains 3rd party assemblies/dlls that are referenced by the different projects in your solution. It is under source control. Project references should point here.
      • tools
        The tools directory contains all 3rd party tools required to build your solution. It, too, is under source control. The tools directory should contain the versions of nAnt, nUnit etc. used by your project — and your build scripts should reference these, rather than the version(s) installed on a developer's machine.
      • bin
        The bin directory contains the output of the build process for the solution. Each projects must be configured to point here.
        • debug
          debug build
        • release
          release build
      • obj
        In the ideal world, each project's obj would be pointed here as well as this has no place in the source tree. Sadly, Visual Studio doesn't offer an official way to do that (though, I'm told, VS can be hacked to do so if you're resourceful enough).
      • src
        The src directory is the root directory for the actual source code of your solution.
        • project1
          The directory for project1.
          • project.csproj`
            The project file.
          • *.cs, etc. files. The source files.
        • ...
        • project-n

How to structure individual projects is, I think, an entirely separate topic, but there should be, WRT to both the solution and the individual projects a correspondence between namespace and file system hierarchy. If a particular project requires a 3rd party assembly that is not to be available to other projects in the solution, an argument could be made for each such projects' directory to its own lib directory, but that scatters 3rd party assemblies across the source tree and so is not recommended.

Nicholas Carey
  • 71,308
  • 16
  • 93
  • 135