1

I have 2 solutions that I'm currently developing. One solution is my main application which has a few projects inside it (DAL, BL, UI and CORE) as layers, and the second solution is a class library that I'm developing (that can be used by any project and not only my first solution) - the first solution uses that class library.

Since my second solution (the class library) is still also under development (and the best way to test it is on a read developing app), in the first solution I have a reference to the Debug DLL of the second solution - so when I make changes to the second solution while working I can already see them affect the real application.

What I'm wondering about is what is the best practice to work in such a case? and when publishing my first solution (the application) how do I make it only for publishing take the Release version of the DLL and not the Debug one that I pointed to?

JasonMArcher
  • 14,195
  • 22
  • 56
  • 52
developer82
  • 13,237
  • 21
  • 88
  • 153
  • There is not one best-practice for these situations, and they are primarily opinion-based. Your approach is fine, especially if you want the quick debug cycle. Another approach would be to only use prebuild versions of the other solution, by for example a build server or on an internal nuget server, but you would not see instant changes. – Rob Tillie Feb 22 '15 at 07:08

1 Answers1

0

You can reference another version of your solution by editing the project file (first unload the project and then edit it in Visual Studio). Now you can change the HintPath for your reference to the following:

<Reference Include="ReferenceAssembly, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
  <SpecificVersion>False</SpecificVersion>
  <HintPath>..\..\..\externals\$(Configuration)\ReferenceAssembly.dll</HintPath>
</Reference>

By using the $(Configuration) parameter, you reference the Debug version when you have the Debug configuration selected. If you want to build a release and set Visual Studio to the Release configuration, it will take the Release version of your reference.

For more background information: here is a detailed blog post about this.

Rob Tillie
  • 1,137
  • 8
  • 30