﻿<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet type='text/css' href='https://stocksharp.ru/css/style.css'?>
<?xml-stylesheet type='text/css' href='https://stocksharp.ru/css/bbeditor.css'?>
<feed xmlns="http://www.w3.org/2005/Atom">
  <title type="html">Exception in Ecng.Reflection.dll</title>
  <id>~/topic/16115/exception-in-ecng_reflection_dll/</id>
  <rights type="text">Copyright @ StockSharp Platform LLC 2010 - 2025</rights>
  <updated>2026-06-05T23:14:34Z</updated>
  <logo>https://stocksharp.ru/images/logo.png</logo>
  <link href="https://stocksharp.ru/handlers/atom.ashx?category=topic&amp;id=16115" rel="self" type="application/rss+xml" />
  <entry>
    <id>https://stocksharp.ru/posts/m/56774/</id>
    <title type="text">Hi me again, I encountered exception in Ecng.Reflection.dll here is the sample code: [code] static v...</title>
    <published>2021-09-17T02:19:36Z</published>
    <updated>2021-09-17T02:19:36Z</updated>
    <author>
      <name>dabithhc</name>
      <uri>https://stocksharp.ru/users/117088/</uri>
      <email>info@stocksharp.ru</email>
    </author>
    <content type="html">&lt;p&gt;Hi me again,
I encountered exception in Ecng.Reflection.dll
here is the sample code:
[code]&lt;br /&gt;
static void Main(string[] args)
{
var path = @&amp;quot;C:\blabla\Storage&amp;quot;;
var storageRegistry = new StorageRegistry
{
DefaultDrive = new LocalMarketDataDrive(path),
};
var security = new Security
{
Id = &amp;quot;APPL@ALL&amp;quot;,
};&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;        var timeFrame = TimeSpan.FromMinutes(1);
        var series = new CandleSeries(typeof(TimeFrameCandle), security, timeFrame);
        var storage = storageRegistry.GetCandleStorage(series);
        var candles = storage.Load(new DateTime(2021, 1, 4));
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;}
[/code]
this snippet works well in .netcoreapp but failed in .net framework4.72
It throws exception when I call GetCandleStorage()
the exception message reports &amp;quot; Type 'System.Lazy&lt;code&gt;1[Ecng.Collections.CachedSynchronizedOrderedDictionary&lt;/code&gt;2[System.DateTime,System.DateTime]]' has '0' members with name '_state' &amp;quot;&lt;/p&gt;
&lt;p&gt;For using legacy dll so I must stay in .net framework, so I wonder is this fixable?&lt;/p&gt;
</content>
    <rights type="html">Copyright @ StockSharp Platform LLC 2010 - 2025</rights>
  </entry>
</feed>