References :release vs. debug  
Author Message

PostPosted: .NET Base Class Library, References :release vs. debug Top

I have a c++ class library with CLR support. It has been built for both release and debug. I added a reference to this class library from my C# windows application project by browsing to the class library's bin\debug folder and picking the class library's dll folder there.

Once my C# windows app was ready for release, the references still point to the debug folder of my class library - no matter which configuration is the active one for my windows app.

How do I reference the debug class library from my debug windows app, and reference the release class library from my release windows app

.NET Development8  

PostPosted: .NET Base Class Library, References :release vs. debug Top

That's not how it works. Select the reference in References node of the Solution Explorer and note the Copy Local property in the Properties window. It will be set to True. The IDE will physically copy the assembly from the C++ build folder to your local Bin\Debug folder. That's the one you're using. If you set it to false and delete the copy, you'll find that your program won't work, it can't find the assembly.

For the Release build, you'll have to determine how the deployed app is going to find the class library assembly. You really only have two options: deploy it with a copy of the assembly in the same folder as the C# .exe or install the assembly in the GAC. Use the former if your C# app is the only one using the assembly, the latter if more than one app needs the assembly.