Visual Studio 2022 Build Fails

Created at 01 Dec 2022, 09:58
How’s your experience with the cTrader Platform?
Your feedback is crucial to cTrader's development. Please take a few seconds to share your opinion and help us improve your trading experience. Thanks!
MB

mbanandetoro6

Joined 01.12.2022

Visual Studio 2022 Build Fails
01 Dec 2022, 09:58


I have been trying to fix build error. Tried to change build target, used command line dotnet build , visual studio build, changed dotnet version, but nothing seems to work, 

I have been getting the following Error when building using visual studio community 2022 with .net 6 and also .net 7

C:\Users\Maulik's Legion\.nuget\packages\ctrader.automate\1.0.5\build\cTrader.Automate.targets(52,9): e
rror MSB4062: The "ExtractMetadataTask" task could not be loaded from the assembly C:\Users\Maulik%27s
Legion\.nuget\packages\ctrader.automate\1.0.5\tools\net6.0\cTrader.Automate.Sdk.Tasks.dll. Could not lo
ad file or assembly 'C:\Users\Maulik%27s Legion\.nuget\packages\ctrader.automate\1.0.5\tools\net6.0\cTr
ader.Automate.Sdk.Tasks.dll'. The system cannot find the path specified. Confirm that the <UsingTask> d
eclaration is correct, that the assembly and all its dependencies are available, and that the task cont
ains a public class that implements Microsoft.Build.Framework.ITask. [C:\Users\Maulik's Legion\Document
s\cAlgo\Sources\Indicators\MYFirstIndicator\MyFirstIndicatorCls\MyFirstIndicatorCls.csproj]

 

I am unable to figure out what is the issue, please help.


@mbanandetoro6
Replies

PanagiotisChar
02 Dec 2022, 07:48

Hi there, 

Can you provide steps for us to reproduce this error?

Aieden Technologies

Need help? Join us on Telegram

Need premium support? Trade with us

 


@PanagiotisChar

mbanandetoro6
04 Dec 2022, 07:26 ( Updated at: 21 Dec 2023, 09:23 )

RE: Steps To reproduce

​​​​​​​Thank you for quick response.

  1. Firstly ,I have installed CTrader v4.5.1, I am using Pepperstone broker.
  2. Then, I have installed visual studio community edition 2022. check below screenshot for version information
    1. visual studio version information image
  3. Then I have created new bot using CTrader , New bot option. Target framework 6.0
  4. Then I have opened it with visual studio using CTrader option "Edit in Visual Studio"
  5. I have Verified That the ctrader automate (v1.0.5 latest) is installed in nuget package manager.
  6. After that whenever I try to build using visual studio the build fails with following error
  7. If I use embedded compiler of CTrader then the build succeeds, if I change the compiler in CTrader settings, then even in CTrader code editor build, I get the same error.
  8. What I have tried so far
    1. I have tried all available versions of ctrader.Automate Nuget package.
    2. I have tried to change target framework.
    3. I have tried to create the project(class library) in visual studio rather then ctrader, and then adding the ctrader.Automate package using nuget.
    4. I have tried to build using terminal "dotnet build"
    5. I have tried to create the project in different disk drive.
    6. I have tried to install other .net dependencies in visual studio. check below screenshot for .net versions and SDKs I have installed.

 

So far I have unable to figure out the cause of the issue.

I am familiar with c# but not familiar with msbuild system. thus i am unable to figure out the issue. i have looked up online. but found no solutions.

If you could help me solve the issue. that would be really helpful.

Currently as a workaround i am editing in visual studio 2022, and using ctrader editor build option.

Thank you.

 


PanagiotisChar said:

Hi there, 

Can you provide steps for us to reproduce this error?

Aieden Technologies

Need help? Join us on Telegram

Need premium support? Trade with us

 

 


@mbanandetoro6

mbanandetoro6
07 Dec 2022, 12:17

RE: RE: Steps To reproduce

I have attached build log using "dotnet build -v diagnostic"

Please check this detailed log file --> Text Log File Google Drive Link


@mbanandetoro6