Using MS Visual Studio 2008, I created a C# library (let's call it main.dll) that relies on a second library (helper.dll). In the Debug version of main.dll, I set a reference to the debug version of helper.dll. But when I switch to build the Release version of main.dll, the output folder still includes the debug version of helper.dll. I do not see a way to select different versions of helper.dll for different build types. In C++, I could tell the linker what folder to get its files from, but I don't see a way to do that for C#.
The typical way of doing this is to have all of your projects in a single solution, and use project references between them. Then, when you build in Debug, all components will be built and referenced as debug - and likewise for Release.
Alternatively, you can use a single output folder for all your assemblies, reference each binary from there, and ensure that the build order is correct - so that your helper.dll is built to that folder before main.dll is built. This is more prone to failure, though, and requires a greater amount of manual maintenance.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With