Hi everyone, I downloaded the zip of lean engine, unzipped and opened solution in VisualStudio 2015 Community. When i first built, a number of packages were automatically downloaded and installed by VS2015. But there are two problems: 1. Resharper shows 2 errors: Solution QuantConnect.Lean.sln Project .nuget .nuget\packages.config: No root tag defined Solution QuantConnect.Lean.sln Project QuantConnect.Configuration Configuration\Config.cs:328 Cannot resolve symbol 'Path' 2. When building, there is only one error: Error CS1061 'JToken' does not contain a definition for 'Path' and no extension method 'Path' accepting a first argument of type 'JToken' could be found (are you missing a using directive or an assembly reference?) QuantConnect.Configuration 'MyProjectDir'\Lean-master\Configuration\Config.cs 328 Active How to fix this so I can build?
Stephen Oehler
Just curious, which project have you set as your Startup Project? Make sure it is the one that ends in "Launcher" and try to do a full Clean Solution, then full Rebuild Solution.
J Hook
Hi Stephen, Yes, QuantConnect.Lean.Launcher is set as startup. Did clean and rebuild solution, and I still get the same build error. And now Resharper detects 85 errors in 18 files, all having to do with Json. (Why build results only in 1 error, while resharper detects 85 errors, I don't know. Weird, isn't it, this programming business)
James Smith
Have you tried disabling resharper code analysis? You might also try Resharper> Options> General> Clear Cache
J Hook
I seem to have found it! Now , hold your hat, because this is going to be a study in MS weirdness... All errors had something to do with Json. So i decided to check all project references, and found strange things indeed. Most projects referenced the correct Json version 7.0.0.0 located at: 'MyProjDir'\Lean-master\packages\Newtonsoft.Json.7.0.1\lib\net45\Newtonsoft.Json.dll But three projects referenced version 4.5.0.0 located at: C:\Program Files (x86)\Microsoft Visual Studio 12.0\Blend\Newtonsoft.Json.dll Which belongs to Visual Studio 2013. Umm, yes, but... duh! The three projects were: QuantConnect.Algorithm.VisualBasic QuantConnect.Configuration QuantConnect.Queues I don't know why these three projects had the wrong assembly reference and not the others. I changed the references and now I can build and run. The thing is, before I installed VS2015 Community, I checked on the net that it is OK to install both VS2013 and VS2015, and from what I found it should works just fine. (Yeah, sure Bill!) You might want to check the solution if there is something special with these three projects. I have been away from programming for the last couple of years. Nice to be back and see that nothing has really changed and the bugs still thrive.
Stephen Oehler
Great job! And thanks for posting such a detailed analysis of the issue. :-)
Michael Handschuh
@J Hook - mind submitting a pull request for the change, this way others can benefit from your fix!
J Hook
@Stephen: Thanks. @Michael: The thing is, I am not sure why the references where wrong. It might not be a problem in the Lean zip i downloaded. Instead something might have gone wrong while VS2015 automatically downloaded the packages that were needed, which would mean it is really beyond my reach. To investigate this, I think someone (Jared?) with a deep knowledge of Lean, VS, nuget and the whole shebang should have a look at the solution. If the solution is OK, then try to replicate and see if the problem is in VS2015 or NuGet or wherever. Good luck, have fun! :) Alternatively, just let it rest for the time being, see if others have the same problem and if so investigate. (this is what I would do at this stage) One thing that seems odd: There is a folder in the solution called .nuget with a file packages.config. This folder and file are both missing, nowhere to be found. Why? Might this have something to do with the problem?
James Smith
J Hook
@James Yes, you are right is in suspecting there are problems with Resharper 10.0.0.2. It is known to not find references that in reality are OK, and Jetbrains seem unable to fix in. (Resharper releases have a reputation of being buggy. Incomprehensible how a company with a basically great product can mismanage it so completely and let greed rule over sanity) But I don't see how Resharper could cause build errors in VS or make the references to assemblies point to an outdated version in some cases, and not in others (but what do I know?). I think we should drop this now and come back to it if it turns out others have the same problem.
J Hook
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!