Breakpoint not hit when debugging with Visual Studio
Author: sburgener
Creation Date: 9/7/2012 11:48 AM
profile picture

sburgener

#1
Hi there,

I went through your post on how to enable Debugging in VisualStudio. Everything works and I am able to see and launch the C# strategies from VisualStudio in the StrategyMonitor (when clicking on "Open Strategy"), but I can't debug the latter.
When opening and running my Visual Studio strategies in Wealth-Lab, the code (in VisualStudio) gets executed correctly. However, when I try to link my C# file in VisualStudio to the process WealthLabDev.exe, the breakpoints disappear with the mention "No symbol have been loaded for this document".

Do I need to activate anything specific in WealthLab to allow debugging? Or is this due to the fact that I am still on a trial version?

Thank you in advance for your help!

Best,
S.
profile picture

Eugene

#2
Hi,

It's a Visual Studio specific question, not a Wealth-Lab issue: for whatever reason, VS could not find the solution's PDB files. Here's a couple of pointers:

* Fixing “The breakpoint will not currently be hit. No symbols have been loaded for this document.” and more of the same on stackoverflow.com
* The breakpoint will not currently be hit. No symbols have been loaded for this document.
profile picture

sburgener

#3
Brilliant, thank you Eugene, it all works fine now!

Your second post pointed me toward the right direction.
For those who might have the same issue, the problem was that when attaching the process, in "Attach to", I had manually selected "Native". When changing the latter to "Automatic" (which still pointed me to "Native code"), it suddenly worked. The post which helped me out was Debugging in Visual Studio .Net.

Thanks again,
S.
profile picture

Eugene

#4
Glad to help Sebastian.
profile picture

dansmo

#5
Hi Eugene,

sorry for bringing up the old thread.
I have exactly the same issue with the breakpoints, but did not find a solution yet. This link http://geekswithblogs.net/dbutscher/archive/2007/06/26/113472.aspx points to a *.PDB file that shall be opened. However I was not able to find a WealthLab.pdb file. Maybe this is already the issue?

Thanks
Daniel
profile picture

Eugene

#6
Hi Daniel

Long time no hear. Sorry that you're having this issue which VS users may face from time to time (myself included). However, this is not a Wealth-Lab issue at all so your best bet is to read all tips you can find on StackOverflow etc.

"WealthLabPro.pdb" file is the wrong direction: such file never existed in production installs. I'd say that this may happen when your PDB does not match the DLL. Possible reasons include:

1. Version mismatch (debug/release version, see below)
2. Inaccurate PC clock
3. Not enough user rights (must be an administrator to build to the WLD main folder or take ownership of DLL/PDB)

From experience, I'd clear entire solution's output either with "Clear Solution" or manually (when solution contains multiple projects), make sure the PC clock is correct, ensure that the output (DLL and PDB) goes to the WLD main folder and rebuild. I'd veriy the timestamps of DLL/PDB with a file manager. For multi-assembly solutions you have to be extra careful about version mismatch (e.g. release version of a dependency assembly will prevent it from being debugged).
profile picture

dansmo

#7
Hi Eugene,

indeed, it´s been a while...and it takes longer to get things working again than expected.

Thank you for your prompt response. When I try to build directly to the WLD main folder VS complains that Community.Components cannot be copied and there is no access right to this path. I am admin so this should not be the problem. Any idea what I am doing wrong?

Best
dansmo
profile picture

Eugene

#8
QUOTE:
VS complains that Community.Components cannot be copied and there is no access right to this path. I am admin so this should not be the problem. Any idea what I am doing wrong?

Sure. Being an admin is not enough. You're not following the instructions precisely:

How can I debug my trading strategies in Wealth-Lab?

What does #9 say in bold? You must be running Visual Studio as administrator for this. This means: right click the VS shortcut and choose "Run as admin".
profile picture

dansmo

#9
Okay, this makes me truly feel like an idiot now :-(
It is now bulding to the path but still no success with the breakpoints.
profile picture

Eugene

#10
At any rate, work out each of my suggestion (DLL and PDB timestamps, PC clock).

Have you tried not attaching to process but starting WLD as an external program (see "Edit and Continue" section)? The C.Components solution is preconfigured for this and it's the version I use myself w/o an issue (it just has some bindings to version control removed).
profile picture

dansmo

#11
Hi Eugene,

I have now tried the alternative route E&C. When starting debug VS shows a message saying that I want to debug a release build of my dll. As you pointed out above this is probably the cause of the issue. However, despite your earlier comments I do not have a clue how to change this to a debug version. What do I have to change?

Thanks
dansmo
profile picture

Eugene

#12
Daniel, it should be very simple:



If the dropdown is missing see this: Toolbar missing 'Release' / 'Debug' dropdown build configuration

As an alternative you could change it from BUILD menu > Configuration Manager... but that's not as convenient as the dropdown box.
profile picture

dansmo

#13
Hi Eugene,

thank you very much, it is now working. As E&C and as attach to process.

Best
dansmo
profile picture

Eugene

#14
Glad to have helped!
This website uses cookies to improve your experience. We'll assume you're ok with that, but you can opt-out if you wish (Read more).