Referecing debug or release DLL

Best practices, code snippets for common functionality, examples, and guidelines.
HansSchl
Posts: 63
Joined: Wed Sep 19, 2018 10:05 am

Referecing debug or release DLL

Post by HansSchl » Tue Sep 22, 2020 4:23 pm

Hi, this is probably not a Ranorex specific question but maybe someone can answer nonetheless. My Ranorex project references a Ranorex user code library which is built in a separate project. That project creates a user code DLL that is either in the bin\Debug or bin\Release folder, depending on which configuration I choose when building the DLL.
In the test project, I added a reference to the DLL, but I did not find a way to reference the Debug DLL for debug builds, and the Release DLL for release builds. Ranorex Studio doesn't let me edit the file path. How should I proceed? Should I always use the Debug DLL, even for Release builds? Or am I doing it wrong altogether?

User avatar
Stub
Posts: 376
Joined: Fri Jul 15, 2016 1:35 pm

Re: Referecing debug or release DLL

Post by Stub » Wed Sep 23, 2020 8:20 am

Reference the project, not the DLL.

HansSchl
Posts: 63
Joined: Wed Sep 19, 2018 10:05 am

Re: Referecing debug or release DLL

Post by HansSchl » Wed Sep 23, 2020 8:31 am

Hi Stub,
Reference the project, not the DLL.
I had thought about that. However, the DLL is built in a controlled environment, and the DLL project need not even exist on the computer where the test is developed.
Am I to expect any problems, running a Release EXE with a debug DLL or vice versa?

Thank you
Hans

User avatar
Stub
Posts: 376
Joined: Fri Jul 15, 2016 1:35 pm

Re: Referecing debug or release DLL

Post by Stub » Wed Sep 23, 2020 8:52 am

Then hack the .CSPROJ file and use Conditions to reference the appropriate DLL.