VS2019 problem in debugging of a dll

2022-05-10T22:37:36.903+00:00

When I try to debug a dll regularly build in debug configuration and after having copied all pdb files in the proper folder I get Modules window empty and the following message at the start of debugging:

"Unable to start program 'C:\Users\carlo.timossi\Projects\CHEMCAD NXT UMA\Debug\Usradd.dll'
C:\Users\carlo.timossi\Projects\CHEMCAD NXT UAM\Debug\Usradd.dll is not a valid Win32 application"

This message has no sense because if I try the dll from the calling program (CHEMCAD) without using the debug, it works perfectly.

What do I have to do?
Thank You in advance for Your support and best regards.

Developer technologies | Visual Studio | Debugging
0 comments No comments
{count} votes

Accepted answer
  1. RLWA32 49,541 Reputation points
    2022-05-10T22:49:45.39+00:00

    Visual Studio cannot start a dll for debugging directly in the same manner as an .exe file. To debug a dll you need to specify an application that will load the dll in the project property page - the command is where you provide the information. The Visual Studio debugger will then start that application and after it loads your dll the debugger will be able to hit any breakpoints in the dll source code that you have set for debugging purposes. You may also want to specify the working directory for the application that loads your dll.

    200726-dllprop.png

    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.