- ago
Hi Glitch,
I am familiar to coding C# in Visual Studio. What is the way to import the Wealth Lab libraries into VS? in order to modify the code in Visual Studio. Any advice would be welcomed.
Thank you.
0
899
Solved
20 Replies

Reply

Bookmark

Sort
Glitch8
 ( 11.81% )
- ago
#1
I just published this video which describes the feature where you can link a Strategy to an external source code file so you can edit it from within Visual Studio ...

https://youtu.be/-HyWetzxjOk
0
- ago
#2
@designer01, let's keep the forum in order and ask different questions in new topics please. Spanned this topic for this purpose. Thanks.
0
- ago
#3
Thank you
0
- ago
#4
This is good for versioning!

But once linked, why not have sync both ways? When I update code in Wealth-Lab, it should just save to the linked file during saving process. That way I can edit in Wealth-Lab and have the versioning done through git etc.

BTW, anything which is more than 10-20 lines, I just use Visual Studio to manage the script using instructions from here - https://www.wealth-lab.com/Discussion/New-instruction-for-using-Visual-Studio-to-develop-and-debug-strategies-5494
...setting breakpoints and stepping through code...🍦🎂
0
Glitch8
 ( 11.81% )
- ago
#5
It's technically not feasible because we cannot inject file monitoring code into other editors like Notepad or Visual Studio. Visual Studio may detect a change and ask to reload the file though.
0
- ago
#6
@Glitch the linking in this build 46 works really good.

https://www.youtube.com/watch?v=-HyWetzxjOk

I have not been able to work it out in Visual Studio though. I have to copy/paste the code from VS to Notepad then save it every time I make a change. Wealth Lab picks the changes from Notepad with no problem.
Than you.
0
Glitch8
 ( 11.81% )
- ago
#7
What version of VS are you using? It’s working for me with VS 2019.
0
- ago
#8
I have VS version 2022 the latest. It updates in Wealth Lab the first time I open the project/class.cs in VS but does not update subsequent saves.
0
- ago
#9
1. Did you click Save (Ctrl-S) in Visual Studio? If seeing the asterisk in its title the file is not saved in VS - no update will occur in WL.
2. Have you tried shutting VS down, what happens in WL then? A file is a file. I do not believe in VS 22 locking it for exclusive access though.
3. Does the button's icon look like "broken link" in WL?
0
- ago
#10
1- Yes, I confirmed in Windows File Explorer it is saving.
2- Yes, It will not import into Wealth Lab.
3- No, it looks ok.
If I copy/paste the .cs file from the VS Project folder to another folder then the file links with no problem. VS must be locking access to it from the project folder. Weird!
0
- ago
#11
If it were locked you could not "copy/paste the .cs file". And the imaginary lock would be released after shutting VS down. It's something different, like pointing to the wrong file.
0
- ago
#12
Yes it is an issue with the saving, not with Wealth Lab. I will continue to troubleshoot.
Thank you.
0
- ago
#13
VS 2022 works with WL7. However if use sqlClient or newtonsoft, make sure your version match with WL7's version.
1
- ago
#14
I tried Visual Studio 2019 and did not link.
The only way it works for me is to save the strategy in Wealth Lab then reopen it and the changes made in VS get saved and shown in the re-opened version.
0
- ago
#15
Then you're probably doing something wrong but we can't tell exactly what it is. As a start in the right direction, can you provide a detailed error report? Indicate what you're doing step by step, with file names and paths, preferably with screenshots. Thanks.
0
- ago
#16
Hi Eugene, Thank you. I created a couple of videos and posted them in Google Drive. Do you have a Google Group at Wealth Lab so I can share it with you. Or another way to post it? They are about 30M in size.
0
- ago
#17
Hi,
Could you share them with support@wealth-lab.com?
0
- ago
#18
Thank you, I sent the files via email.
0
- ago
#19
Got them, thanks. I wasn't able to reproduce the test case though. Apparently it's specific to your configuration, like file access rights or something about that D: drive.
0
Best Answer
- ago
#20
Yes you were right I saved the VS Project in the C drive and linked with WL file with no issues.
Thank you.
1

Reply

Bookmark

Sort