- ago
I having trouble setting the output path of Visual Studio 2022 to the WL8 install directory. I have it configured as shown in the screenshot, but VS places the output in the \obj\Release\net6.0-windows\ directory instead. How do I fix that?


Here's my Superticker.Indicators.csproj file.
CODE:
<Project Sdk="Microsoft.NET.Sdk"> <PropertyGroup> <TargetFramework>net6.0</TargetFramework> <ImplicitUsings>enable</ImplicitUsings> <Nullable>enable</Nullable> <BaseOutputPath>C:\Program Files\Quantacula, LLC\WealthLab 8</BaseOutputPath> <PlatformTarget>x64</PlatformTarget> </PropertyGroup> <ItemGroup> <Compile Remove="Indicators.cs" /> <Compile Remove="PercentileRobust.cs" /> <Compile Remove="RankThres.cs" /> <Compile Remove="RankThresTerse.cs" /> <Compile Remove="RSDifNm.cs" /> </ItemGroup> <ItemGroup> <Reference Include="WealthLab.AdvancedSmoothers"> <HintPath>..\..\..\..\..\..\..\Program Files\Quantacula, LLC\WealthLab 8\WealthLab.AdvancedSmoothers.dll</HintPath> </Reference> <Reference Include="WealthLab.Core"> <HintPath>..\..\..\..\..\..\..\Program Files\Quantacula, LLC\WealthLab 8\WealthLab.Core.dll</HintPath> </Reference> </ItemGroup> </Project>
1
3,593
Solved
17 Replies

Reply

Bookmark

Sort
- ago
#1
I misspoke. Visual Studio 2022 is locating the personal (local) C# DLL libraries into the WL8 install directory as directed, but it's putting them in a \Release\ subdirectory instead.

CODE:
...\Program Files\Quantacula, LLC\WealthLab 8\Release\net6.0\
Is this normal? Will WL8 find the DLLs in subdirectories (if they aren't explicitly mentioned in the manifest)? If not, how do I fix this?
0
- ago
#2
Here's your question asked at StackOverflow:

https://stackoverflow.com/questions/70562307/how-to-avoid-visual-studio-2022-to-add-project-configuration-to-output-path

And to place all solution outputs in a common directory you can supposedly change the UseCommonOutputDirectory property as suggested by Microsoft:

https://docs.microsoft.com/en-us/visualstudio/ide/how-to-change-the-build-output-directory?view=vs-2022
1
- ago
#3
The above links were helpful, but they aren't quite enough. What I did was take a Project file (*.csprog) from a previous project (which works) and adapted it to the new WL8 project file.

CODE:
<Project Sdk="Microsoft.NET.Sdk"> <PropertyGroup> <TargetFramework>net6.0</TargetFramework> <ImplicitUsings>enable</ImplicitUsings> <Nullable>enable</Nullable> <BaseOutputPath>C:\Program Files\Quantacula, LLC\WealthLab 8\</BaseOutputPath> <PlatformTarget>x64</PlatformTarget> <EnableNETAnalyzers>False</EnableNETAnalyzers> <AppendTargetFrameworkToOutputPath>False</AppendTargetFrameworkToOutputPath> <AppendRuntimeIdentifierToOutputPath>False</AppendRuntimeIdentifierToOutputPath> <UseCommonOutputDirectory>True</UseCommonOutputDirectory> </PropertyGroup> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'"> <OutputPath>$(BaseOutputPath)</OutputPath> </PropertyGroup> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'"> <OutputPath>$(BaseOutputPath)</OutputPath> </PropertyGroup> . . . </Project>
Defining the <OutputPath> property is what really matters here. Somehow VS can't formulate it correctly by itself.
4
- ago
#4
@superticker, are you able to get the strategies to show up in WL strategies list? I can see my DLL being copied but seems like I have to restart WL everytime in order to see the strategies I created in VS populate in WL.

Another issue I am running into is that if WL is open then it can't create the dll because WL is using the existing project dll so it can not override it, were you experiencing this at all?

QUOTE:
Severity Code Description Project File Line Suppression State
Warning MSB3026 Could not copy "obj\Debug\StrategyTest.dll" to "C:\Program Files\Quantacula, LLC\WealthLab 8\StrategyTest.dll". Beginning retry 4 in 1000ms. The process cannot access the file 'C:\Program Files\Quantacula, LLC\WealthLab 8\StrategyTest.dll' because it is being used by another process. The file is locked by: "WealthLab8 (26480)" StrategyTest C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Current\Bin\amd64\Microsoft.Common.CurrentVersion.targets 4631

0
Glitch8
 ( 9.67% )
- ago
#5
This is all expected behavior. WL only loads compiled strategies at startup.
2
Best Answer
MIH8
- ago
#6
Hello superticker,

i think you already know what the problem was. Imho, the reason why you created subfolders is that you used



instead of

CODE:
<OutputPath>C:\Program Files\Quantacula, LLC\WealthLab 8\</OutputPath>


You can find further information at
https://github.com/MicrosoftDocs/visualstudio-docs/blob/main/docs/msbuild/common-msbuild-project-properties.md
2
mrsic8
 ( 8.28% )
- ago
#7
Hello,

I need help wit debugging.

I've set the output path. Start VS as admin and WL8 is open. And I am getting still the error message after setting breakpoints and starting debugging.

My project for this strategy is in C:\Users\damir\source\repos.

Is this the wrong folder?

0
- ago
#8
When following this guide,
https://www.wealth-lab.com/Support/ExtensionApi/StrategyLibrary

You missed this step (corrected for WL8):

QUOTE:
On Build tab, set Output path to: "c:\Program Files\Quantacula, LLC\WealthLab 8"
On Debug tab, set Executable to: "c:\Program Files\Quantacula, LLC\WealthLab 8\WealthLab8.exe"
1
mrsic8
 ( 8.28% )
- ago
#9
Hi Eugene,

until so fine.

Do I have put these two lines (<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath<AppendRuntimeIdentifierToOutputPath>false</AppendRuntimeIdentifierToOutputPath>) in: See picture editorconfig


I can't see an Executable tab in Debug. See Picutere

In Target Framework below 6 as was in WL6 there were a "Start external programm."

Maybe someone can make a short step-by-step video on how to set up debugging properly. If I get this right, I'll make one.




0
- ago
#10
Damir, if you click on "Open debug launch profiles UI" there would be a new dialog which lets you specify the path to the WL8 executable to run.
0
- ago
#11
I still use the way via Ctrl+Alt+P because I was not able to start "C:\Program Files\Quantacula, LLC\WealthLab 8\WealthLab8.exe" out of VS 2022 via "debug launch profiles UI". This also means that WealthLab8.exe must be already "in memory".

Actually, this way is not that bad because in general, the start of WealthLab8.exe simply takes too long. The disadvantage here is that I can't compile the DLL's directly into the directory C:\Program Files\Quantacula, LLC\WealthLab 8.

Perhaps there is a better way?
0
MIH8
- ago
#12
First, you can still check Post #8 in https://www.wealth-lab.com/Discussion/Visual-Studio-is-unable-to-overwrite-the-class-library-while-WL8-is-open-8067
Second, here is the project file i use. The entries for the ItemGroup are generated automatically with referencing the libraries you will use. (At least the WealthLab.Core)

CODE:
<Project Sdk="Microsoft.NET.Sdk"> <PropertyGroup> <TargetFramework>net6.0</TargetFramework> <RootNamespace>Trade_BB</RootNamespace> <ImplicitUsings>enable</ImplicitUsings> <Nullable>enable</Nullable>    <OutputPath>C:\Program Files\Quantacula, LLC\WealthLab 8\</OutputPath>    <AppendTargetFrameworkToOutputPath>False</AppendTargetFrameworkToOutputPath> <AppendRuntimeIdentifierToOutputPath>False</AppendRuntimeIdentifierToOutputPath> <UseCommonOutputDirectory>True</UseCommonOutputDirectory> </PropertyGroup> <ItemGroup> <Reference Include="WealthLab.AdvancedSmoothers"> <HintPath>..\..\..\..\..\..\Program Files\Quantacula, LLC\WealthLab 8\WealthLab.AdvancedSmoothers.dll</HintPath> </Reference> <Reference Include="WealthLab.Core"> <HintPath>..\..\..\..\..\..\Program Files\Quantacula, LLC\WealthLab 8\WealthLab.Core.dll</HintPath> </Reference> <Reference Include="WealthLab.TASC"> <HintPath>..\..\..\..\..\..\Program Files\Quantacula, LLC\WealthLab 8\WealthLab.TASC.dll</HintPath> </Reference> </ItemGroup> </Project>


Third, run Visual Studio in admin mode. Done.

This should work if you use the correct project type.
0
mrsic8
 ( 8.28% )
- ago
#13
Hi Eugene,

Thanks.

Can someone explain me why I am getting this message. "No Symbols have been loaded..."

How is that possible? After starting Debugging, WL start to open before laoding any symbols.





0
- ago
#14
I can suggest to Clean the project and Rebuild before debugging. Repeat until it works.
0
- ago
#15
Hi. If I am trying to debug a strategy in VS 2022, what type of project do I need to create in VS to perform this? Is it a c# wpf class library or something else? I think it's something else but I don't know. I know I can't execute a class library.
0
- ago
#16
@mas429 - see: https://www.wealth-lab.com/Discussion/How-to-Set-up-WL-on-Visual-Studio-8372
0
- ago
#17
I'm sorry I still don't get it.

But I am able to do a post-build event to copy my strategy.dll to the wealth lab directory. After that, I startup WL8. In VS, I attach WL8, set my breakpoints, and run the backtest in WL8. It stops in VS.
1

Reply

Bookmark

Sort