I'm trying to build a library with Visual Studio for use in WL. I can't get the library to show up in the Tools-Assembly References menu.
I am creating a test library on .net 6.0, I tried to build it under x86 and x64.
Please help me understand what I'm doing wrong.
If necessary, I can record the entire process of creating a dll on video.
I am creating a test library on .net 6.0, I tried to build it under x86 and x64.
CODE:
namespace testLibrary { public static class TestClass { public static int TestFunc() { return 0; } } }
Please help me understand what I'm doing wrong.
If necessary, I can record the entire process of creating a dll on video.
Rename
Which one of detailed API Library instructions are you following?
https://wealth-lab.com/Support/ExtensionApi
https://wealth-lab.com/Support/ExtensionApi
QUOTE:
I can't get the library to show up in the Tools-Assembly References menu.
Where did you even read about this? Our manuals never suggest it. Your library will not appear there unless it's installed in the GAC, and you don't need it.
Solution: place your assembly's DLL file in the "Wealth-Lab 8" folder under Program Files\Quantacula, LLC.
QUOTE:
creating a test library on .net 6.0, I tried to build it under x86 and x64.
Off topic, but you should build your library strictly for x64 and not include x86. There's nothing in WL8 that's x86 compatible.
QUOTE:
Which one of detailed API Library instructions are you following?
https://wealth-lab.com/Support/ExtensionApi
I did not find information about including libraries in the official manual. But I found a topic on a third-party forum:
http://www.wealth-lab.net/Forums/Thread.aspx?pageid=2&t=138~-1
I would like to see this information in an official source, including information about the compatibility of libraries and WL8 (Framework version and bitness).
I have successfully included the library:
https://www.alglib.net/
On the advice of Eugene, I simply copied the library to the WL8 folder. Although it didn't appear in the Assembly References list, it worked.
Thank you all for your help.
Great to hear you got it working!
The instructions for copying custom assemblies appear here,
I think it would be less confusing for new users if there were either a blog post or an entry in the Extension API page (even though we aren't building an extension) much like the "StrategyLibrary API" section. The working assumption is that developers will search the forum for "Visual Studio" to locate this information. And, although that works, it's not ideal (otherwise, we wouldn't be seeing a post like this). Integrating all the Visual-Studio forum posts into a "How to develop a custom/local code library" section would make the most sense.
I would have called them "local" or "external" assemblies rather than custom assembles. Perhaps I'm too traditional.
Off topic, but I like https://numerics.mathdotnet.com/ a little better than https://www.alglib.net/ because the former is written in C#, so bindings are better if you're using C#.
I wouldn't call external libraries directly from your strategy code because the data types between WL and the external libraries won't agree. Instead, write local, high-level stub code that converts the data types along with their other high-level functions.
I would have called them "local" or "external" assemblies rather than custom assembles. Perhaps I'm too traditional.
Off topic, but I like https://numerics.mathdotnet.com/ a little better than https://www.alglib.net/ because the former is written in C#, so bindings are better if you're using C#.
I wouldn't call external libraries directly from your strategy code because the data types between WL and the external libraries won't agree. Instead, write local, high-level stub code that converts the data types along with their other high-level functions.
I'm trying to reference my dlls, I copied them into c:\Program Files\Quantacula, LLC\WealthLab 8\, WL8 seems to see the library, as it proposes to add reference to the library (see the screenshot). But if I select this item, it closes and nothing happens. And I can't see the library under Tools -> Assembly References. This is a C#12 library, compiled for Any CPU.

What could be the reason?
Thank you!
What could be the reason?
Thank you!
You mean if you select this item in Intellisense in the editor?
Your libraries won’t show up under Tools, Ams Ref, only .NET libraries will.
It looks like there’s some dependent assembly missing. Did you copy over all dependent assemblies?
Your libraries won’t show up under Tools, Ams Ref, only .NET libraries will.
It looks like there’s some dependent assembly missing. Did you copy over all dependent assemblies?
QUOTE:
You mean if you select this item in Intellisense in the editor?
Yes, that's correct.
QUOTE:
Your libraries won’t show up under Tools, Ams Ref, only .NET libraries will.
OK, I see, but as I understand, all non .NET libraries should be auto-referenced if they are in the c:\Program Files\Quantacula, LLC\WealthLab 8\ folder
QUOTE:
It looks like there’s some dependent assembly missing. Did you copy over all dependent assemblies?
As far as I know, all are included. Please see that Microsoft.Extensions.Logging (which I copied too) is not visible too
QUOTE:
And I can't see the library under Tools -> Assembly References.
That's your problem. You need to fix that.
So you're saying you placed the relevant DLLs in the WL install directory and restarted WL and they don't show up in Tools -> Assembly References?
Were the AiStocks libraries created with VS? I see TorchSharp is recognized okay.
Assembles you drop into the WL folder won’t be shown in the Assembly References tool. They’re referenced automatically.
QUOTE:
Were the AiStocks libraries created with VS?
Yes, they were created in VS2022, targeted at .NET 8 with C# 12. Work just fine from a console app.
QUOTE:
I see TorchSharp is recognized okay.
Yes, and it is inside AiStocks. And others namespaces (e.g. AiStocks.Agent) are not recognized, that's really interesting.
And of course I restarted WL8 as specified in manuals.
QUOTE:
Assembles you drop into the WL folder won’t be shown in the Assembly References tool. They’re referenced automatically.
May be it's a nice feature to have two pages in Tools -> Assembly References. Global and Custom, so at least users can see that dll's are really loaded. As currently Intellisense proposes to Fix the problem by referencing, then I click on it, then nothing happens. So it somehow sees AiStocks.
Thank you
Another thing is that it doesn't see Microsoft.Extensions.Logging
We'll get Microsoft.Extensions.Logging.Abstractions available for selection in the Assembly References tool for Build 139. Some Microsoft assemblies that are included with the WL8 install aren't available for selection there, so we'll need to add them explicitly as demand indicates.
It's in place for Build 139 so keep your eyes open for that release, should come in a week or so.
QUOTE:
As currently Intellisense proposes to Fix the problem by referencing, then I click on it, then nothing happens. So it somehow sees AiStocks.
So IntelliSense sees them, but cannot bind to them. This is a question for the Visual Studio forum.
I realize you've already done this, but the binding step is not working. So what I would do is "repackage" AiStocks in a new project and do so in a way that it doesn't expose any foreign datatypes to WL. You could create a stub project called AiStocks2WLinterface that references the AiStocks as they are and also creates any WL TimeSeries objects to pass to the WL strategy itself. But you want to avoid referencing any namespace references from AiStocks directly in the strategy itself.
Yes, I know this sounds like a round about solution. Perhaps the Visual Studio forum will have a better binding solution. Are you sure there aren't any namespace conflicts between AiStocks and WealthLab? If there are, VS may flag them in your AiStocks2WLinterface project. Look for those errors.
---
You know the brute force solution to namespace conflicts is to dump all the AiStocks using statements and just address its methods the verbose way.
CODE:
var creator = new AiStocks.Api.AiStocksCreator(Settings.Environment,...
Thanks for the advice. I will need to double-check everything on my side. If it's fine, then potentially a wrapper can be a workround solution.
Your Response
Post
Edit Post
Login is required