I have some projects for which I use the “Library” (code sharing) feature.
While running those on Python was no issue, I did not manage to run them with C#.
I am getting the error
ERROR:: Runtime Error: Could not load file or assembly
'MyLibrary, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'. The system cannot find the
file specified.
Does anybody know what this might be due to?
Autocomplete works and recognises the library as I added the project and library to the solution and referenced the library as explained in the documentation. However, when running with lean backtest “MyProject” I get the above error.
Thanks!
R G Quant
I opened the docker cli on the running LEAN container and saw that indeed there is no .dll for my referenced project. Has anybody encountered the same issue?
R G Quant
As a temporary solution to debug locally, before attaching the debugger I connect to the container and run
cp /Compile/bin/MyLibrary.dll /Lean/Launcher/bin/Debug
For some reason this is not performed during initialisation. I don't know if it is a bug or I am missing something..
Raffaele
I think I reported a very similar or the same issue here:
I also did not find a way to properly share code in C# projects, such that it works in local development, local backtesting and cloud backtesting.
R G Quant
The material on this website is provided for informational purposes only and does not constitute an offer to sell, a solicitation to buy, or a recommendation or endorsement for any security or strategy, nor does it constitute an offer to provide investment advisory services by QuantConnect. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. QuantConnect makes no guarantees as to the accuracy or completeness of the views expressed in the website. The views are subject to change, and may have become unreliable for various reasons, including changes in market conditions or economic circumstances. All investments involve risk, including loss of principal. You should consult with an investment professional before making any investment decisions.
To unlock posting to the community forums please complete at least 30% of Boot Camp.
You can continue your Boot Camp training progress from the terminal. We hope to see you in the community soon!