﻿<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet type='text/css' href='https://stocksharp.com/css/style.css'?>
<?xml-stylesheet type='text/css' href='https://stocksharp.com/css/bbeditor.css'?>
<feed xmlns="http://www.w3.org/2005/Atom">
  <title type="html">4.1.3 Перестала работать загрузка параметров стратегии</title>
  <id>~/topic/2953/4_1_3-perestala-rabotat-zagruzka-parametrov-strategii/</id>
  <rights type="text">Copyright @ StockSharp Platform LLC 2010 - 2025</rights>
  <updated>2026-06-20T18:32:19Z</updated>
  <logo>https://stocksharp.com/images/logo.png</logo>
  <link href="https://stocksharp.com/handlers/atom.ashx?category=topic&amp;id=2953" rel="self" type="application/rss+xml" />
  <entry>
    <id>https://stocksharp.com/posts/m/21045/</id>
    <title type="text">Mikhail Sukhov: Unit так просто не сохранить в файл. Там нужно регистрировать загрузчик инструментов...</title>
    <published>2012-08-27T02:35:40Z</published>
    <updated>2012-08-27T02:37:18Z</updated>
    <author>
      <name>PavelAd</name>
      <uri>https://stocksharp.com/users/6072/</uri>
      <email>info@stocksharp.com</email>
    </author>
    <content type="html">&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;&lt;a href="@message(21022)" rel="nofollow" target="_blank"&gt;Mikhail Sukhov&lt;/a&gt;:&lt;/strong&gt;
Unit так просто не сохранить в файл. Там нужно регистрировать загрузчик инструментов для инициализации Unit.Security&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;И как тогда быть? Возожно привести пример такого загрузчика?
Замечу еще раз что в 4.1.2 в старом формате все выгружалось, например:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&amp;lt;StopLoss type=&amp;quot;StockSharp.BusinessEntities.Unit, StockSharp.BusinessEntities, Version=4.1.2.0, Culture=neutral, PublicKeyToken=null&amp;quot;&amp;gt;
&amp;lt;Security hasValue=&amp;quot;false&amp;quot; /&amp;gt;
&amp;lt;Type&amp;gt;0&amp;lt;/Type&amp;gt;
&amp;lt;Value&amp;gt;120&amp;lt;/Value&amp;gt;
&amp;lt;/StopLoss&amp;gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;В новом формате сложные типы (например индикаторы) выгружаются без проблем, например EMA:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&amp;lt;KeyValuePairBeginStringAndObjectEnd&amp;gt;
&amp;lt;key&amp;gt;MAHigh&amp;lt;/key&amp;gt;
&amp;lt;value&amp;gt;
&amp;lt;Type type=&amp;quot;string&amp;quot;&amp;gt;StockSharp.Algo.Indicators.ExponentialMovingAverage, StockSharp.Algo.Indicators, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null&amp;lt;/Type&amp;gt;
&amp;lt;Value type=&amp;quot;StockSharp.Algo.Indicators.ExponentialMovingAverage, StockSharp.Algo.Indicators, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null&amp;quot;&amp;gt;
&amp;lt;Length&amp;gt;10&amp;lt;/Length&amp;gt;
&amp;lt;Name&amp;gt;ExponentialMovingAverage&amp;lt;/Name&amp;gt;
&amp;lt;/Value&amp;gt;
&amp;lt;/value&amp;gt;
&amp;lt;/KeyValuePairBeginStringAndObjectEnd&amp;gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;почему Unit не выгружается по аналогии:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&amp;lt;KeyValuePairBeginStringAndObjectEnd&amp;gt;
&amp;lt;key&amp;gt;StopLoss&amp;lt;/key&amp;gt;
&amp;lt;value&amp;gt;
&amp;lt;Type type=&amp;quot;string&amp;quot;&amp;gt;StockSharp.BusinessEntities.Unit, StockSharp.BusinessEntities, Version=4.1.4.0, Culture=neutral, PublicKeyToken=null&amp;lt;/Type&amp;gt;
&amp;lt;Value type=&amp;quot;StockSharp.BusinessEntities.Unit, StockSharp.BusinessEntities, Version=4.1.4.0, Culture=neutral, PublicKeyToken=null&amp;quot;&amp;gt;
&amp;lt;Security hasValue=&amp;quot;false&amp;quot; /&amp;gt;
&amp;lt;Type&amp;gt;0&amp;lt;/Type&amp;gt;
&amp;lt;Value&amp;gt;120&amp;lt;/Value&amp;gt;
&amp;lt;/Value&amp;gt;
&amp;lt;/value&amp;gt;
&amp;lt;/KeyValuePairBeginStringAndObjectEnd&amp;gt;&lt;/p&gt;
&lt;/blockquote&gt;
</content>
    <rights type="html">Copyright @ StockSharp Platform LLC 2010 - 2025</rights>
  </entry>
  <entry>
    <id>https://stocksharp.com/posts/m/21022/</id>
    <title type="text">PavelAd: Ошибка подтверждается7 Unit так просто не сохранить в файл. Там нужно регистрировать загруз...</title>
    <published>2012-08-24T14:57:26Z</published>
    <updated>2012-08-24T14:57:26Z</updated>
    <author>
      <name>Mikhail Sukhov</name>
      <uri>https://stocksharp.com/users/201/</uri>
      <email>info@stocksharp.com</email>
    </author>
    <content type="html">&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;&lt;a href="@message(21017)" rel="nofollow" target="_blank"&gt;PavelAd&lt;/a&gt;:&lt;/strong&gt;
Ошибка подтверждается7&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Unit так просто не сохранить в файл. Там нужно регистрировать загрузчик инструментов для инициализации Unit.Security&lt;/p&gt;
</content>
    <rights type="html">Copyright @ StockSharp Platform LLC 2010 - 2025</rights>
  </entry>
  <entry>
    <id>https://stocksharp.com/posts/m/21017/</id>
    <title type="text">Ошибка подтверждается7 </title>
    <published>2012-08-24T14:27:06Z</published>
    <updated>2012-08-24T14:27:06Z</updated>
    <author>
      <name>PavelAd</name>
      <uri>https://stocksharp.com/users/6072/</uri>
      <email>info@stocksharp.com</email>
    </author>
    <content type="html">&lt;p&gt;Ошибка подтверждается7&lt;/p&gt;
</content>
    <rights type="html">Copyright @ StockSharp Platform LLC 2010 - 2025</rights>
  </entry>
  <entry>
    <id>https://stocksharp.com/posts/m/20997/</id>
    <title type="text">Измененный пример SampleHistoryTesting где повторяется ошибка </title>
    <published>2012-08-24T00:48:56Z</published>
    <updated>2012-08-24T00:52:42Z</updated>
    <author>
      <name>PavelAd</name>
      <uri>https://stocksharp.com/users/6072/</uri>
      <email>info@stocksharp.com</email>
    </author>
    <content type="html">&lt;p&gt;Измененный пример SampleHistoryTesting где повторяется ошибка&lt;/p&gt;
</content>
    <rights type="html">Copyright @ StockSharp Platform LLC 2010 - 2025</rights>
  </entry>
  <entry>
    <id>https://stocksharp.com/posts/m/20972/</id>
    <title type="text">Ошибку повторил используя пример SampleHistoryTesting добавив сериализацию объекта Unit. </title>
    <published>2012-08-23T05:57:24Z</published>
    <updated>2012-08-23T05:57:24Z</updated>
    <author>
      <name>PavelAd</name>
      <uri>https://stocksharp.com/users/6072/</uri>
      <email>info@stocksharp.com</email>
    </author>
    <content type="html">&lt;p&gt;Ошибку повторил используя пример SampleHistoryTesting добавив сериализацию объекта Unit.&lt;/p&gt;
</content>
    <rights type="html">Copyright @ StockSharp Platform LLC 2010 - 2025</rights>
  </entry>
  <entry>
    <id>https://stocksharp.com/posts/m/20969/</id>
    <title type="text">Чтобы получить файл настроек в новом формате вызываю как и раньше: var StopLossSize = new Unit(200, ...</title>
    <published>2012-08-23T00:58:44Z</published>
    <updated>2012-08-23T01:38:47Z</updated>
    <author>
      <name>PavelAd</name>
      <uri>https://stocksharp.com/users/6072/</uri>
      <email>info@stocksharp.com</email>
    </author>
    <content type="html">&lt;p&gt;Чтобы получить файл настроек в новом формате вызываю как и раньше:&lt;/p&gt;
&lt;pre&gt;&lt;code class="language-csharp"&gt;
var StopLossSize = new Unit(200, UnitTypes.Limit);
....
settings.SetValue(&amp;quot;StopLossSize&amp;quot;, StopLossSize);
new XmlSerializer&amp;lt;SettingsStorage&amp;gt;().Serialize(settings, &amp;quot;settings_template.xml&amp;quot;);

&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;и получаю исключение:&lt;/p&gt;
&lt;blockquote&gt;
&lt;h2 id="system.reflection.targetinvocationexception-message.sourcemscorlib-stacktrace-system.runtimemethodhandle._invokeconstructoriruntimemethodinfo-method-object-args-signaturestruct-signature-runtimetype-declaringtype-system.runtimemethodhandle.invokeconstructoriruntimemethodinfo-method-object-args-signaturestruct-signature-runtimetype-declaringtype-system.reflection.runtimeconstructorinfo.invokebindingflags-invokeattr-binder-binder-object-parameters-cultureinfo-culture-system.runtimetype.createinstanceimplbindingflags-bindingattr-binder-binder-object-args-cultureinfo-culture-object-activationattributes-system.activator.createinstancetype-type-bindingflags-bindingattr-binder-binder-object-args-cultureinfo-culture-object-activationattributes-system.activator.createinstancetype-type-object-args-ecng.common.typehelper.createinstanceargstype-type-object-args-ecng.serialization.reflectionfieldfactoryattribute.createfactoryfield-field-ecng.serialization.typeschemafactory.c_displayclass11.createschemab_dfieldfactoryattribute-a-system.linq.enumerable.whereselectarrayiterator2.movenext-system.collections.generic.list1.ctorienumerable1-collection-system.linq.enumerable.tolisttsourceienumerable1-source-ecng.serialization.typeschemafactory.createschematype-entitytype-ecng.serialization.schemamanager.c_displayclass5.getschemab_4type-key-ecng.collections.collectionhelper.safeaddtkeytvalueidictionary2-dictionary-tkey-key-func2-handler-boolean-isnew-ecng.collections.collectionhelper.safeaddtkeytvalueidictionary2-dictionary-tkey-key-func2-handler-ecng.serialization.schemamanager.getschematype-entitytype-schemafactory-factory-ecng.serialization.schemamanager.getschematype-entitytype-ecng.serialization.schemamanager.getschematentity-ecng.serialization.serializer1.get_schema-ecng.serialization.serializer1.getfields-ecng.serialization.serializer1.serializet-graph-serializationitemcollection-source-ecng.serialization.serializer1.ecng.serialization.iserializer.serializeobject-graph-serializationitemcollection-source-ecng.serialization.innerschemafieldfactory1.oncreatesourceiserializer-serializer-tentity-instance-ecng.serialization.fieldfactory2.oncreatesourceiserializer-serializer-object-instance-ecng.serialization.dynamicfieldfactory.oncreatesourceiserializer-serializer-object-instance-ecng.serialization.fieldfactory2.oncreatesourceiserializer-serializer-object-instance-ecng.serialization.fieldfactory.createsourceiserializer-serializer-object-instance-ecng.serialization.serializer1.serializet-graph-fieldlist-fields-serializationitemcollection-source-ecng.serialization.serializer1.serializet-graph-serializationitemcollection-source-ecng.serialization.realcollectionfieldfactory2.oncreatesourceiserializer-serializer-tcollection-instance-ecng.serialization.fieldfactory2.oncreatesourceiserializer-serializer-object-instance-ecng.serialization.fieldfactory.createsourceiserializer-serializer-object-instance-ecng.serialization.serializer1.serializet-graph-fieldlist-fields-serializationitemcollection-source-ecng.serialization.serializer1.serializet-graph-fieldlist-fields-stream-stream-ecng.serialization.serializer1.serializet-graph-stream-stream-ecng.serialization.serializer1.serializet-graph-ecng.serialization.serializer1.serializet-graph-string-filename-tradestrategy.tresurestrategy.savesettingsstorage-settings-ctradetradestrategytradestrategytresurestrategy.cs-2004-tradestrategy.tresurestrategy.onstopped-ctradetradestrategytradestrategytresurestrategy.cs-367-stocksharp.algo.strategies.strategy.q9zjyah_tjtripkxrpmmvpaf8lhmr7xpjkff8p_sbsxyprocessstates-qk93m3ac1jahkyhuxnljmuw-innerexception-microsoft.practices.servicelocation.activationexception-messageactivation-error-occured-while-trying-to-get-instance-of-type-istorage-key-sourcemicrosoft.practices.servicelocation-stacktrace-microsoft.practices.servicelocation.servicelocatorimplbase.getinstancetype-servicetype-string-key-microsoft.practices.servicelocation.servicelocatorimplbase.getinstancetservice-ecng.configuration.configmanager.getservice-ecng.serialization.relationfieldfactory2.ctorfield-field-int32-order-ecng.serialization.relationsinglefieldfactory2.ctorfield-field-int32-order-innerexception-microsoft.practices.unity.resolutionfailedexception-messageresolution-of-the-dependency-failed-type-ecng.serialization.istorage-name-none.exception-occurred-while-while-resolving.exception-is-invalidoperationexception-the-current-type-ecng.serialization.istorage-is-an-interface-and-cannot-be-constructed.are-you-missing-a-type-mapping"&gt;System.Reflection.TargetInvocationException не обработано пользовательским кодом
Message=Адресат вызова создал исключение.
Source=mscorlib
StackTrace:
в System.RuntimeMethodHandle._InvokeConstructor(IRuntimeMethodInfo method, Object[] args, SignatureStruct&amp;amp; signature, RuntimeType declaringType)
в System.RuntimeMethodHandle.InvokeConstructor(IRuntimeMethodInfo method, Object[] args, SignatureStruct signature, RuntimeType declaringType)
в System.Reflection.RuntimeConstructorInfo.Invoke(BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
в System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes)
в System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes)
в System.Activator.CreateInstance(Type type, Object[] args)
в Ecng.Common.TypeHelper.CreateInstanceArgs(Type type, Object[] args)
в Ecng.Serialization.ReflectionFieldFactoryAttribute.CreateFactory(Field field)
в Ecng.Serialization.TypeSchemaFactory.&amp;lt;&amp;gt;c__DisplayClass11.&amp;lt;CreateSchema&amp;gt;b__d(FieldFactoryAttribute a)
в System.Linq.Enumerable.WhereSelectArrayIterator&lt;code&gt;2.MoveNext() в System.Collections.Generic.List&lt;/code&gt;1..ctor(IEnumerable&lt;code&gt;1 collection) в System.Linq.Enumerable.ToList[TSource](IEnumerable&lt;/code&gt;1 source)
в Ecng.Serialization.TypeSchemaFactory.CreateSchema(Type entityType)
в Ecng.Serialization.SchemaManager.&amp;lt;&amp;gt;c__DisplayClass5.&amp;lt;GetSchema&amp;gt;b__4(Type key)
в Ecng.Collections.CollectionHelper.SafeAdd[TKey,TValue](IDictionary&lt;code&gt;2 dictionary, TKey key, Func&lt;/code&gt;2 handler, Boolean&amp;amp; isNew)
в Ecng.Collections.CollectionHelper.SafeAdd[TKey,TValue](IDictionary&lt;code&gt;2 dictionary, TKey key, Func&lt;/code&gt;2 handler)
в Ecng.Serialization.SchemaManager.GetSchema(Type entityType, SchemaFactory factory)
в Ecng.Serialization.SchemaManager.GetSchema(Type entityType)
в Ecng.Serialization.SchemaManager.GetSchema&lt;a href="" rel="nofollow" target="_blank"&gt;TEntity&lt;/a&gt;
в Ecng.Serialization.Serializer&lt;code&gt;1.get_Schema() в Ecng.Serialization.Serializer&lt;/code&gt;1.GetFields()
в Ecng.Serialization.Serializer&lt;code&gt;1.Serialize(T graph, SerializationItemCollection source) в Ecng.Serialization.Serializer&lt;/code&gt;1.Ecng.Serialization.ISerializer.Serialize(Object graph, SerializationItemCollection source)
в Ecng.Serialization.InnerSchemaFieldFactory&lt;code&gt;1.OnCreateSource(ISerializer serializer, TEntity instance) в Ecng.Serialization.FieldFactory&lt;/code&gt;2.OnCreateSource(ISerializer serializer, Object instance)
в Ecng.Serialization.DynamicFieldFactory.OnCreateSource(ISerializer serializer, Object instance)
в Ecng.Serialization.FieldFactory&lt;code&gt;2.OnCreateSource(ISerializer serializer, Object instance) в Ecng.Serialization.FieldFactory.CreateSource(ISerializer serializer, Object instance) в Ecng.Serialization.Serializer&lt;/code&gt;1.Serialize(T graph, FieldList fields, SerializationItemCollection source)
в Ecng.Serialization.Serializer&lt;code&gt;1.Serialize(T graph, SerializationItemCollection source) в Ecng.Serialization.RealCollectionFieldFactory&lt;/code&gt;2.OnCreateSource(ISerializer serializer, TCollection instance)
в Ecng.Serialization.FieldFactory&lt;code&gt;2.OnCreateSource(ISerializer serializer, Object instance) в Ecng.Serialization.FieldFactory.CreateSource(ISerializer serializer, Object instance) в Ecng.Serialization.Serializer&lt;/code&gt;1.Serialize(T graph, FieldList fields, SerializationItemCollection source)
в Ecng.Serialization.Serializer&lt;code&gt;1.Serialize(T graph, FieldList fields, Stream stream) в Ecng.Serialization.Serializer&lt;/code&gt;1.Serialize(T graph, Stream stream)
в Ecng.Serialization.Serializer&lt;code&gt;1.Serialize(T graph) в Ecng.Serialization.Serializer&lt;/code&gt;1.Serialize(T graph, String fileName)
в TradeStrategy.TresureStrategy.Save(SettingsStorage settings) в C:\Trade\TradeStrategy\TradeStrategy\TresureStrategy.cs:строка 2004
в TradeStrategy.TresureStrategy.OnStopped() в C:\Trade\TradeStrategy\TradeStrategy\TresureStrategy.cs:строка 367
в StockSharp.Algo.Strategies.Strategy.#=q9ZjYAh_tjTRiPKXRpMmVPaf8lHMr7XpjKfF8P_SBSxY=(ProcessStates #=qK93m3AC1JAhKyhuxNljMUw==)
InnerException: Microsoft.Practices.ServiceLocation.ActivationException
Message=Activation error occured while trying to get instance of type IStorage, key &amp;quot;&amp;quot;
Source=Microsoft.Practices.ServiceLocation
StackTrace:
в Microsoft.Practices.ServiceLocation.ServiceLocatorImplBase.GetInstance(Type serviceType, String key)
в Microsoft.Practices.ServiceLocation.ServiceLocatorImplBase.GetInstance&lt;a href="" rel="nofollow" target="_blank"&gt;TService&lt;/a&gt;
в Ecng.Configuration.ConfigManager.GetService()
в Ecng.Serialization.RelationFieldFactory&lt;code&gt;2..ctor(Field field, Int32 order) в Ecng.Serialization.RelationSingleFieldFactory&lt;/code&gt;2..ctor(Field field, Int32 order)
InnerException: Microsoft.Practices.Unity.ResolutionFailedException
Message=Resolution of the dependency failed, type = &amp;quot;Ecng.Serialization.IStorage&amp;quot;, name = &amp;quot;(none)&amp;quot;.
Exception occurred while: while resolving.
Exception is: InvalidOperationException - The current type, Ecng.Serialization.IStorage, is an interface and cannot be constructed. Are you missing a type mapping?&lt;/h2&gt;
&lt;p&gt;At the time of the exception, the container was:&lt;/p&gt;
&lt;p&gt;Resolving Ecng.Serialization.IStorage,(none)&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;        Source=Microsoft.Practices.Unity
        TypeRequested=IStorage
        StackTrace:
             в Microsoft.Practices.Unity.UnityContainer.DoBuildUp(Type t, Object existing, String name, IEnumerable`1 resolverOverrides)
             в Microsoft.Practices.Unity.UnityContainer.DoBuildUp(Type t, String name, IEnumerable`1 resolverOverrides)
             в Microsoft.Practices.Unity.UnityContainer.Resolve(Type t, String name, ResolverOverride[] resolverOverrides)
             в Microsoft.Practices.Unity.UnityServiceLocator.DoGetInstance(Type serviceType, String key)
             в Microsoft.Practices.ServiceLocation.ServiceLocatorImplBase.GetInstance(Type serviceType, String key)
        InnerException: System.InvalidOperationException
             Message=The current type, Ecng.Serialization.IStorage, is an interface and cannot be constructed. Are you missing a type mapping?
             Source=Microsoft.Practices.Unity
             StackTrace:
                  в Microsoft.Practices.ObjectBuilder2.DynamicMethodConstructorStrategy.ThrowForAttemptingToConstructInterface(IBuilderContext context)
                  в BuildUp_Ecng.Serialization.IStorage(IBuilderContext )
                  в Microsoft.Practices.ObjectBuilder2.DynamicMethodBuildPlan.BuildUp(IBuilderContext context)
                  в Microsoft.Practices.ObjectBuilder2.BuildPlanStrategy.PreBuildUp(IBuilderContext context)
                  в Microsoft.Practices.ObjectBuilder2.StrategyChain.ExecuteBuildUp(IBuilderContext context)
                  в Microsoft.Practices.Unity.UnityContainer.DoBuildUp(Type t, Object existing, String name, IEnumerable`1 resolverOverrides)
             InnerException:
&lt;/code&gt;&lt;/pre&gt;
&lt;/blockquote&gt;
&lt;p&gt;Исключение выходит только в случае сохранения параметров типа Unit&lt;/p&gt;
</content>
    <rights type="html">Copyright @ StockSharp Platform LLC 2010 - 2025</rights>
  </entry>
  <entry>
    <id>https://stocksharp.com/posts/m/20968/</id>
    <title type="text">Mikhail Sukhov: Файл сохранен предыдущей версией? Да. Направление понятно </title>
    <published>2012-08-23T00:35:41Z</published>
    <updated>2012-08-23T00:35:41Z</updated>
    <author>
      <name>PavelAd</name>
      <uri>https://stocksharp.com/users/6072/</uri>
      <email>info@stocksharp.com</email>
    </author>
    <content type="html">&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;&lt;a href="@message(20967)" rel="nofollow" target="_blank"&gt;Mikhail Sukhov&lt;/a&gt;:&lt;/strong&gt;
Файл сохранен предыдущей версией?&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Да. Направление понятно&lt;/p&gt;
</content>
    <rights type="html">Copyright @ StockSharp Platform LLC 2010 - 2025</rights>
  </entry>
  <entry>
    <id>https://stocksharp.com/posts/m/20967/</id>
    <title type="text">Файл сохранен предыдущей версией? </title>
    <published>2012-08-22T21:43:52Z</published>
    <updated>2012-08-22T21:43:52Z</updated>
    <author>
      <name>Mikhail Sukhov</name>
      <uri>https://stocksharp.com/users/201/</uri>
      <email>info@stocksharp.com</email>
    </author>
    <content type="html">&lt;p&gt;Файл сохранен предыдущей версией?&lt;/p&gt;
</content>
    <rights type="html">Copyright @ StockSharp Platform LLC 2010 - 2025</rights>
  </entry>
  <entry>
    <id>https://stocksharp.com/posts/m/20954/</id>
    <title type="text">Загружаю параметры стратегии так: if (System.IO.File.Exists(&amp;quot;settings.xml&amp;quot;)) { //Загрузка настроек с...</title>
    <published>2012-08-22T07:31:51Z</published>
    <updated>2012-08-22T07:31:51Z</updated>
    <author>
      <name>PavelAd</name>
      <uri>https://stocksharp.com/users/6072/</uri>
      <email>info@stocksharp.com</email>
    </author>
    <content type="html">&lt;p&gt;Загружаю параметры стратегии так:&lt;/p&gt;
&lt;pre&gt;&lt;code class="language-csharp"&gt; 
if (System.IO.File.Exists(&amp;quot;settings.xml&amp;quot;)) {
  //Загрузка настроек стратегии из существующего конфигурационного файла
  var settingsStorage = new XmlSerializer&amp;lt;SettingsStorage&amp;gt;().Deserialize(&amp;quot;settings.xml&amp;quot;);
}

&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;В строке 3 выдается исключение:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;System.ArgumentNullException не обработано
Message=Значение не может быть неопределенным.
Имя параметра: key
Source=mscorlib
ParamName=key
StackTrace:
в System.Collections.Generic.Dictionary&lt;code&gt;2.Insert(TKey key, TValue value, Boolean add) в System.Collections.Generic.Dictionary&lt;/code&gt;2.Add(TKey key, TValue value)
в Ecng.Collections.SynchronizedDictionary&lt;code&gt;2.Add(TKey key, TValue value) в Ecng.Collections.SynchronizedDictionary&lt;/code&gt;2.Add(KeyValuePair&lt;code&gt;2 item) в Ecng.Serialization.CollectionEntityFactory&lt;/code&gt;2.CreateEntity(ISerializer serializer, SerializationItemCollection source)
в Ecng.Serialization.EntityFactory&lt;code&gt;1.CreateObject(ISerializer serializer, SerializationItemCollection source) в Ecng.Serialization.Serializer&lt;/code&gt;1.Deserialize(SerializationItemCollection source, FieldList fields)
в Ecng.Serialization.Serializer&lt;code&gt;1.Deserialize(Stream stream, FieldList fields) в Ecng.Serialization.Serializer&lt;/code&gt;1.Deserialize(Stream stream)
в Ecng.Serialization.Serializer`1.Deserialize(String fileName)
в 4.1.2 все работало.&lt;/p&gt;
&lt;/blockquote&gt;
</content>
    <rights type="html">Copyright @ StockSharp Platform LLC 2010 - 2025</rights>
  </entry>
</feed>