Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Separate or same folders for Debug/Release output when using .NET (C#)? [closed]

What is the best practice for defining the target output folder for Debug/Release: Is it better to have separate folders for Debug/Release or should I use the same folder for both (when using .NET/C#)?

I have two separate solutions, so the projects of one solution can't have a reference by project to a project of the other solution. So you are forced to add a reference to the assembly file directly. This results in another problem: If you add a reference to another assembly via a file you can add only one instead of one for debug and one fore release (like you can do with libraries in C++). Another problem is that I have to add a reference, for example, to bin/Release/MyOtherProject/MyAssembly.dll. I think this is confusing, especially when building Debug and having referenced Release. => Build errors and version conflicts may occur.

Has anyone long experience in building into the same target folder in large projects and environments?

It is a more precise question related to Stack Overflow question Should we still make a difference between the release and debug output folders?.

like image 467
Beachwalker Avatar asked Jan 24 '12 19:01

Beachwalker


2 Answers

We have been using the same directory for debug and release in .NET applications for 10 years and have never had a problem.

This approach makes numerous tasks substantially easier, such as building installs, copying custom DLL files to directories post-build, and versioning files in the output directories such as license files that are necessary for developers to run the application correctly.

like image 129
competent_tech Avatar answered Sep 21 '22 14:09

competent_tech


If they are two different solutions, I don't see a good reason why you would want to reference the Debug output. In fact, I don't think you should be referencing the output in the other projects directory at all. Your references could be broken if the code is moved to another machine and you don't perfectly replicate your project structure.

I think best practice would be to either

1) Have a Lib directory in Project / Solution A that you manually copy the output of Project / Solution B. Do this if you do not make changes to Project B very often.

2) Put both projects in the same solution, then add a reference to the project. Remember, you can have one project in multiple solutions. Do this if you are developing both projects at the same time.

like image 45
cadrell0 Avatar answered Sep 25 '22 14:09

cadrell0