I am working on a code in c++. This code is compiled into a dll file which is loaded by a java application. When debugging, I normally run the application (from Eclipse) and attach to javaw.exe process in Visual studio 2017. This worked fine for a long time until I got a new computer (with same operating system, windows 10, as the previous one). On this new computer I use the same procedure to attach and debug, but randomly I get warnings that symbols are not loaded and breakpoints will not be hit. In this case I close the application, open it again, attach, and everything works fine. I do not know exactly where the symbols are, and what is the problem, but it is annoying to have to close and reopen the application. Any ideas on what might be the reason for this issue and how it can be resolved?
Also I do not know what further information I can provide, but if you could think of anything that might help, please ask. Thanks.
I know there are many questions about loading symbols and hitting breakpoints, but so far I could not find an answer that solves my problem.
in the "Attach to Process" window (Debug>>Attach to Process), the "Attach to:" field is set to "Automatic" by default.
In my case, I was debugging native code, but there were some small parts of the big project that dealt with exporting to/importing from excel. So visual studio sometimes (specially when the app had just loaded) categorized the project that I was attaching to as Native (in this case breakpoints worked fine), and sometimes recognized my project as Managed (in this case it could not load symbols).
As I knew that I was debugging the Native code all the time, I changed the "Attach to:" field to "Native" and now it works as desired.