Custom DLL crashes WLP with ArgumentOutOfRange exception
Author: tomphm
Creation Date: 1/20/2017 8:32 PM
profile picture

tomphm

#1
Recently I created a DLL via MS Visual Studio Express 2015 and run it on WLP and got WLP crashed on start up.

The error messages are below:

Problem signature:
Problem Event Name: CLR20r3
Problem Signature 01: WealthLabPro.exe
Problem Signature 02: 1.0.0.0
Problem Signature 03: 57d80a3f
Problem Signature 04: mscorlib
Problem Signature 05: 4.6.1087.0
Problem Signature 06: 583e5c1a
Problem Signature 07: 504
Problem Signature 08: 7c
Problem Signature 09: System.ArgumentOutOfRange
OS Version: 6.1.7601.2.1.0.768.3
Locale ID: 1033
Additional Information 1: 9b98
Additional Information 2: 9b98bd2fb1cd442bde11ffb46bb2d08c
Additional Information 3: 09b7
Additional Information 4: 09b742cac54ecf43b1d64704fe9c06cb

I went through the troubleshooting page on Wiki http://www2.wealth-lab.com/WL5WIKI/kbErrorsGeneral.ashx and followed through the procedure on 'Crash on Start Up'. Renaming the WLP main folder does allow WLP to start but will crash if a new Strategy editor window to open. If I was to delete the newly created DLL, WLP would start. I have uninstall and reinstall WLP but the problem still there. I deleted MS .Net Framework 4.5.1 SDK and reinstall it but still no progress.

I believe the problem is with the newly created DLL but could not located the source of the problem. Initially when I first build the DLL, it is set to .NET Framework 4.6 (a bit reckless on my part), I am not sure if this is the cause of the problem. When setting it back to .NET Framework 4.5, the problem does not go away.

I have tried to deleted the "EditorVersion=1.51" in WealthLabConfig.txt" and the file itself but with the newly DLL present, WLP crashs. The crash only go away if the 'troubled" DLL is removed. A different DLL created also via MS Visual Studio Express 2015 would allow to WLP to start up and working fine. It just one particular DLL that causes the crash. Thanks.
profile picture

Eugene

#2
Just for the record, what we've determined is that following these workarounds doesn't help as the problem's caused by the DLL itself.

Something is wrong either with your code or the build/solution settings. As troubleshooting the unknown DLL is hardly practical, I'd create a new project from scratch and then tediously copy the code to it piece by piece.
profile picture

tomphm

#3
Yes, I have went through the workarounds but it does not help. I have also deleted and re-create Visual Studio Project from scratch but the problem still there. I am also concern if the problem from the incompatible DLL is not spreading and corrupted something else. I went back again to create project from scratch and still WLP would crash on start up.

The steps to went through to setup project settings is not many and the same as those I used for others. I went back checked them carefully including the code and could find anything stand out.
profile picture

Eugene

#4
As long as WLP functions normally after removing the corrupt DLL there's nothing to worry about. There are too many unknowns to offer any specific advice but here are some bits that you can give a try:

1. Check project bitness (should be Any CPU)
2. If both x86/x64 builds of WLP are installed, make sure the project doesn't reference the incorrect version
3. Try different build configurations (debug, release, custom)
4. Not sure why you haven't mentioned it before but set up a breakpoint in the main entry point of your library and step into the code to find the offending segment
5. Try installing SharpDevelop, it's lightweight compared to VS. Clean envrionment should help prove that the problem is in your code
profile picture

tomphm

#5
1 & 2 have been checked and confirmed. 3. No. I have not try step 4 since I was thinking the error is from WLP and not from the code hence not setup break point there. 5. Will look into.

Anyhow, setting up break point right at beginning of the code, I was able to catch the error - System.TypeInitializizationException (attached). I checked the Wiki @ http://www2.wealth-lab.com/WL5WIKI/kbErrorsGeneral.ashx there is a section under Wealth-Lab throws a TimeZoneInformation exception, where the error is the same but generated under different condition. I am not sure if the solution posted there with related to TimeZone is applicable. Checked my clock and time zone seems to indicated it is in correct settings.

profile picture

tomphm

#6
A check at my recent Windows Update history does not explicitly shows any update related to KB955839 as mentioned in Wealth-Lab throws a TimeZoneInformation exception in Wiki is on it. A first glance look at the update itself seems not to indicated anything about time zone. https://support.microsoft.com/en-us/help/3212646/january-2017-security-monthly-quality-rollup-for-windows-7-sp1-and-win

profile picture

tomphm

#7
Have applied solution guidelines from Wiki's Wealth-Lab crashes on start after changing regional settings and Wealth-Lab Pro 6.5 crashes on start with System.TypeInitialization in WealthLab.ChartControl (.Net 4.5 was removed and reinstalled before reinstallation of WLP) both do not help with the issue.
profile picture

Eugene

#8
TypeInitializizationException in WealthLabPro.MainModule pictures a typical startup exception. It's not related to KB955839 and does not contain further information by itself.

Do not apply guidelines any more from the Wiki as they are not related to custom DLL development. Your problem is different and is only caused by your own code of your unknown library. Considering this I have nothing else to suggest.
profile picture

tomphm

#9
Everyone code and DLLs are unique and custom. The question is what in the code that ticks WLP, knowing this so that we can develop better code.
profile picture

Eugene

#10
There's a thousand ways to shoot WLP in the foot with unknown code - very custom and creative ways. I appreciate if you share your findings for the community benefit. Until I then it's not clear what do you like to hear from me. And if it's about getting some assistance then it's about time to share the demo project.
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).