What's new
  • Visit Rebornbuddy
  • Visit Panda Profiles
  • Visit LLamamMagic
  • Visit Resources
  • Visit Downloads
  • Visit Portal

Error read default Settings

Status
Not open for further replies.

Barok

Member
Joined
Sep 11, 2014
Messages
231
Reaction score
0
В проект VS2012 в параметры добавляю настройку на пользователя
In project VS2012 in parametrs add Settings users
cf7dc0a34172236e9995d7486d07e418.png

В методе загрузки формы читаю эту настройку
In method load form read this a setting
Code:
private void View_Load(object sender, EventArgs e)
{
lang = Properties.Settings.Default.lang;
....
if (lang == "ru")
   translateRU();
else if (lang == "en")
   translateEN();
}

И в итоге получаю экзепшн
When loading I receive an exception

Code:
Приложение: Updater.exe
Версия платформы: v4.0.30319
Описание. Процесс был завершен из-за необработанного исключения.
Сведения об исключении: System.AccessViolationException
Стек:
   в System.Reflection.RuntimeAssembly.GetRawBytes(RuntimeAssembly assembly, ObjectHandleOnStack retRawBytes)
   в System.Reflection.RuntimeAssembly.GetRawBytes()
   в System.Security.Policy.Hash.GetRawData()
   в System.Security.Policy.Hash.GenerateDefaultHashes()
   в System.Security.Policy.Hash.OnSerializing(StreamingContext ctx)
   в System.AppDomain.get_Evidence()
   в System.AppDomain.get_EvidenceNoDemand()
   в System.AppDomain.get_Evidence()
   в System.Configuration.ClientConfigPaths.GetEvidenceInfo(System.AppDomain, System.String, System.String ByRef)
   в System.Configuration.ClientConfigPaths.GetTypeAndHashSuffix(System.AppDomain, System.String)
   в System.Configuration.ClientConfigPaths..ctor(System.String, Boolean)
   в System.Configuration.ClientConfigPaths.GetPaths(System.String, Boolean)
   в System.Configuration.Internal.ConfigurationManagerInternal.System.Configuration.Internal.IConfigurationManagerInternal.get_ExeProductName()
   в System.Configuration.ApplicationSettingsBase.get_Initializer()
   в System.Configuration.ApplicationSettingsBase.CreateSetting(System.Reflection.PropertyInfo)
   в System.Configuration.ApplicationSettingsBase.EnsureInitialized()
   в System.Configuration.ApplicationSettingsBase.get_Properties()
   в System.Configuration.SettingsBase.GetPropertyValueByName(System.String)
   в System.Configuration.SettingsBase.get_Item(System.String)
   в System.Configuration.ApplicationSettingsBase.GetPropertyValue(System.String)
   в System.Configuration.ApplicationSettingsBase.get_Item(System.String)
   в SmartTrader.Properties.Settings.get_lang()
   в SmartTrader.View.View_Load(System.Object, System.EventArgs)
   в System.Windows.Forms.Form.OnLoad(System.EventArgs)
   в System.Windows.Forms.Form.OnCreateControl()
   в System.Windows.Forms.Control.CreateControl(Boolean)
   в System.Windows.Forms.Control.CreateControl()
   в System.Windows.Forms.Control.WmShowWindow(System.Windows.Forms.Message ByRef)
   в System.Windows.Forms.Control.WndProc(System.Windows.Forms.Message ByRef)
   в System.Windows.Forms.ScrollableControl.WndProc(System.Windows.Forms.Message ByRef)
   в System.Windows.Forms.ContainerControl.WndProc(System.Windows.Forms.Message ByRef)
   в System.Windows.Forms.Form.WmShowWindow(System.Windows.Forms.Message ByRef)
   в System.Windows.Forms.Form.WndProc(System.Windows.Forms.Message ByRef)
   в System.Windows.Forms.Control+ControlNativeWindow.OnMessage(System.Windows.Forms.Message ByRef)
   в System.Windows.Forms.Control+ControlNativeWindow.WndProc(System.Windows.Forms.Message ByRef)
   в System.Windows.Forms.NativeWindow.Callback(IntPtr, Int32, IntPtr, IntPtr)
   в System.Windows.Forms.SafeNativeMethods.ShowWindow(System.Runtime.InteropServices.HandleRef, Int32)
   в System.Windows.Forms.Control.SetVisibleCore(Boolean)
   в System.Windows.Forms.Form.SetVisibleCore(Boolean)
   в System.Windows.Forms.Control.set_Visible(Boolean)
   в System.Windows.Forms.Application+ThreadContext.RunMessageLoopInner(Int32, System.Windows.Forms.ApplicationContext)
   в System.Windows.Forms.Application+ThreadContext.RunMessageLoop(Int32, System.Windows.Forms.ApplicationContext)
   в System.Windows.Forms.Application.RunDialog(System.Windows.Forms.Form)
   в System.Windows.Forms.Form.ShowDialog(System.Windows.Forms.IWin32Window)
   в System.Windows.Forms.Form.ShowDialog()
   в SmartTrader.Main.<PluginRun>b__0()
   в System.Threading.ThreadHelper.ThreadStart_Context(System.Object)
   в System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
   в System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
   в System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object)
   в System.Threading.ThreadHelper.ThreadStart()
Если убрать чтение настройки, то все проходит успешно. В чем проблема подскажите?
If to remove reading settings, everything passes successfully. In what a problem prompt?
 
Last edited:
Status
Not open for further replies.
Back
Top