Barok
Member
- Joined
- Sep 11, 2014
- Messages
- 231
- Reaction score
- 0
В проект VS2012 в параметры добавляю настройку на пользователя
In project VS2012 in parametrs add Settings users
В методе загрузки формы читаю эту настройку
In method load form read this a setting
И в итоге получаю экзепшн
When loading I receive an exception
Если убрать чтение настройки, то все проходит успешно. В чем проблема подскажите?
If to remove reading settings, everything passes successfully. In what a problem prompt?
In project VS2012 in parametrs add Settings users

В методе загрузки формы читаю эту настройку
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: