Hi, after upgrading to latest build, 21, am getting the following error. Have
CODE:
System.Windows.Extensions.dll in C:\Program Files\Quantacula, LLC\WealthLab 8
Rename
You can look up the error message on Stackoverflow or Google, for example:
https://stackoverflow.com/questions/3154198/cant-find-system-windows-media-namespace
https://stackoverflow.com/questions/3154198/cant-find-system-windows-media-namespace
Make sure your Wealth-Lab extensions are up-to-date. If so, please post a screen shot of your strategy if it is a building block strategy. If your strategy is a C# strategy, please show the "using" statements, at least.
Did you by any chance add a custom assembly reference? It could be that one of the recent optimizations is interfering with that, I’ll investigate. Update: I didn't find anything at our end, it might help if we see the strategy code that produces the error.
Knowing that you're a power user familiar with C#, simply open Tools > Assembly References and review. That PresentationCore may be unchecked, and so on.
Please allow me to clarify - it worked for a year. Latest working build was 18. It started right after build 21 upgrade. Code, assembly references, dll in the right place. The only thing that changed was the upgrade.
I didn't add a custom assembly. I might have in the past but the error message complains references System.Media.
PresentationCore.dll is not the correct assembly. It's using System.Windows.Media while I use System.Media. To use the SoundPlayer function (to play a .wav file). That function is part of System.Windows.Extensions.dll which is in
C:\Program Files\Quantacula, LLC\WealthLab 8 and I have been using for a long time. https://learn.microsoft.com/en-us/dotnet/api/system.media.soundplayer?view=dotnet-plat-ext-7.0&viewFallbackFrom=net-6.0
Any change to build 21 compared to past builds? Newer assemblies/.Net version/etc?
I tried reverting to build 18 but the install would not allow me to revert.
Below is a generic code that uses the SoundPlayer function directly, without the need for 'using'.
I didn't add a custom assembly. I might have in the past but the error message complains references System.Media.
PresentationCore.dll is not the correct assembly. It's using System.Windows.Media while I use System.Media. To use the SoundPlayer function (to play a .wav file). That function is part of System.Windows.Extensions.dll which is in
C:\Program Files\Quantacula, LLC\WealthLab 8 and I have been using for a long time. https://learn.microsoft.com/en-us/dotnet/api/system.media.soundplayer?view=dotnet-plat-ext-7.0&viewFallbackFrom=net-6.0
Any change to build 21 compared to past builds? Newer assemblies/.Net version/etc?
I tried reverting to build 18 but the install would not allow me to revert.
Below is a generic code that uses the SoundPlayer function directly, without the need for 'using'.
CODE:
using WealthLab.Backtest; using System; using WealthLab.Core; using WealthLab.Indicators; using System.Collections.Generic; //using System.Media; namespace WealthScript2 { public class MyStrategy : UserStrategyBase { //create indicators and other objects here, this is executed prior to the main trading loop public override void Initialize(BarHistory bars) { System.Media.SoundPlayer beep = new System.Media.SoundPlayer(@"c:\Windows\Media\chimes.wav"); } //execute the strategy rules here, this is executed once for each bar in the backtest history public override void Execute(BarHistory bars, int idx) { if (!HasOpenPosition(bars, PositionType.Long)) { //code your buy conditions here } else { //code your sell conditions here } } //declare private variables below } }
I found a very recent version of the DLL and overwrote the older one in the WL's folder, see screenshot. Same error.
I don’t see anything in Build 21 per se that affected this, but I do see that the WindowsDesktop assemblies such as PresentationCore are not available in the Assembly Reference tool, and I also can’t get the SoundPlayer to compile in a Strategy. I’ll work on getting it resolved for Build 22.
OK, WindowsDesktop assemblies are now available in the Assembly References tool for Build 22, and I confirmed SoundPlayer works with System.Windows.Extensions checked as a reference!
I see that build 21 is the latest on the site. I'll look out for build 22.
Thank you Glitch!
Thank you Glitch!
Your Response
Post
Edit Post
Login is required