Back

Runtime error in VS Solution

I'm using the VS solution. It builds without error. However, at runtime it generates this exception:

_ramTotalCounter = new PerformanceCounter("Memory", "Available Bytes");

Exception details are:

System.InvalidOperationException
  HResult=0x80131509
  Message=Could not locate Performance Counter with specified category name 'Memory', counter name 'Available Bytes'.
  Source=System
  StackTrace:
   at System.Diagnostics.PerformanceCounter.InitializeImpl()
   at System.Diagnostics.PerformanceCounter..ctor(String categoryName, String counterName, String instanceName, Boolean readOnly)
   at System.Diagnostics.PerformanceCounter..ctor(String categoryName, String counterName)
   at QuantConnect.OS.get_RamTotalCounter() in C:\Users\Sidney\Desktop\Lean-master\Lean-master\Common\OS.cs:line 49
   at QuantConnect.OS.get_TotalPhysicalMemory() in C:\Users\Sidney\Desktop\Lean-master\Lean-master\Common\OS.cs:line 194
   at QuantConnect.Lean.Launcher.Program.Main(String[] args) in C:\Users\Sidney\Desktop\Lean-master\Lean-master\Launcher\Program.cs:line 75
 

Is anyone else having this problem? How did you resolve it?

Update Backtest







We have never seen this issue before and couldn't reproduce the issue.
From my research on this issue, I found this: Performance Counters in .Net.
It might help to fix your particular case.

0

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.


Might also want to give this a shot (check the Answer): 

https://answers.microsoft.com/en-us/windows/forum/windows_7-performance/perfmon-problems-unable-to-add-counters/e90f231d-0014-457d-8b1f-5f342971597a
0

https://answers.microsoft.com/en-us/windows/forum/windows_7-performance/perfmon-problems-unable-to-add-counters/e90f231d-0014-457d-8b1f-5f342971597a?auth=1

Perfect solution to this vexing problem, Douglas !!!

Note: I did have to run the lodctr /r twice in elevated permissions to get it to work. Otherwise, it's an excellent fix. Worth a beer next time you're in Rio :)

Best,

Merlin

0

Hey! Glad it worked. Very strange error indeed. Compiling sure can be a lot harder than one thinks :(

0

Update Backtest





0

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.


Loading...

This discussion is closed

 
";