- ago
Let me preface my issue by stating that it is one for the general audience and not necessarily for the WealthLab staff. I understand that a solution may be rather involved and is not something the WealthLab crew would support or want to dedicate time.

This question is targeted for a person that has already solved the issue of debugging custom DLLs with JetBrains Rider. So, here goes...

I build WealthLab 8 strategies in a custom DLL. To do so, I use JetBrains Rider which is an IDE like Visual Studio. In a nutshell, I have followed the instructions for debugging with Visual Studio (ref: https://www.wealth-lab.com/Support/ExtensionApi/StrategyLibrary). However, in Rider, it is necessary to also add what Rider calls a Run configuration, and I have done that, too. The "Run" configuration tells Rider what exe to launch (in this case WealthLab.exe) when debugging a DLL.

In Rider I hit the debug button and the DLL is compiled and copied successfully to the WealthLab folder. WealthLab runs and Rider stops at the breakpoints set in the constructors of my strategies - no problem. In Rider, I can single-step through the constructors just fine. This is while WealthLab is launching, so I guess its snooping for parameters in the strategies.

However, if I backtest a strategy, then no breakpoints get hit. In Rider the breakpoints are shown as active. I put breakpoints in Initialize and Execute, but they are never hit when backtesting.

If somebody has solved this problem, please let me know what you did to solve it. If you need more info, please let me know.

Thanks, Paul
0
832
Solved
3 Replies

Reply

Bookmark

Sort
- ago
#1
Hi Paul,

Thanks for the note. I am just starting with WL and am trying o use Rider to do the coding work (I prefer JetBrains IDEs). I did also follow the setup suggested but I am a bit stuck with setting up Run part. Are you able to assist me with showing the way in such. By working on the same platform, maybe I will be able to contribute to the solution you are seeking.

Many thanks,

Peter
0
- ago
#2
Hello, Peter:

I got it working. For the following I presume, in general, you:

Have a solution with a C# class library project where your strategies are coded.
You build this solution using the "Debug (Any CPU)" solution configuration.
Without WealthLab currently running, copy the C# class library project .DLL, .PDB and .JSON file to the WealthLab executable folder (C:\Program Files\Quantacula, LLC\WealthLab 8) presuming you installed WealthLab 8 to the default installation folder.

The following Rider "Run/Debug configuration" works for me, so you'll need to create one with these settings:



To debug from Rider select the "WealthLab8" Run/Debug configuration you created (or whatever you chose to call your configuration) and launch a debug session. This will start WealthLab.

In WealthLab make sure that you pick your coded strategies from the appropriate branch in the Strategy tree. There should be a node in that tree that is the same name as your DLL. Open that node and then open a strategy that you want to debug. That strategy should not show any C# code (in WealthLab) because its a compiled DLL.

Now you can set breakpoints in Rider, run your strategy, and the breakpoints should be hit, etc.
0
Best Answer
- ago
#3
Many thanks Paul

It worked like a charm. If you don't mind, I wanted to confirm a "few" things, being:

1) You have modified header (as per VS instructions)?

2) For the Release profile, did you create configuration Publish to Folder and do you use that for a final solution or do you simply paste the code in WL?

3) For the instructions above - you might want to add the location of .DLL, .PDB and .JSON files, being in a bin/Debug folder in the project (if someone else is using your guide and is a bit confused)

4) Is there a way that Rider does not need to relaunch WL for every debug session?

5) Do you add multiple strategies as class files in the same project (i.e. Solution is Wealth Lab, project is Strategy and class is 52_week_high.cs and the new one is 12_week_high.cs....etc.) or do you create new projects under the same solution (i.e. Solution is Wealth Lab, project is 52_week-high, next project is 12_week_high and each has its own class file) or do you have to execute new solution for each strategy (i.e. Wealth_Lab solution becomes 52_week_high, next solution is 12_week_high and the all have their project Strategy and their class.cs)?

6) How are you dealing with symbol loading and step execution once WL runs and you open the strategy in it and start debugging?

Apologies for so many q...I am coming from C/C++ dev on frameworks for IoT in CLion so still figuring things out.

Many thanks for saving me a lot of experimentation time. Now we have two people looking for the solution to your q..lol.

Happy strategising!!
0

Reply

Bookmark

Sort