Test Foro de elhacker.net SMF 2.1

Programación => Programación General => .NET (C#, VB.NET, ASP) => Mensaje iniciado por: Eleкtro en 18 Marzo 2013, 14:00 PM

Título: [SOLUCIONADO] Ayuda con esta excepción! (my.settings)
Publicado por: Eleкtro en 18 Marzo 2013, 14:00 PM
Tengo un problema con el namespace My.Settings cuando intento modificar un valor y guardar las settings (Me sucede con cualquier propiedad...):

Código (vbnet) [Seleccionar]
   Private Sub Button1_Click(Sender As Object, e As MouseEventArgs) Handles Button1.Click
       My.Settings.Remember_Settings = True
       My.Settings.Save()
   End Sub


Me salta este error:

(http://img542.imageshack.us/img542/35/prtscrcapturec.jpg)

Esta es la excepción:
System.Configuration.ConfigurationErrorsException was unhandled
 BareMessage=Configuration system failed to initialize
 HResult=-2146232062
 Line=0
 Message=Configuration system failed to initialize
 Source=System.Configuration
 StackTrace:
      at System.Configuration.ClientConfigurationSystem.OnConfigRemoved(Object sender, InternalConfigEventArgs e)
      at System.Configuration.Internal.InternalConfigRoot.RemoveConfigImpl(String configPath, BaseConfigurationRecord configRecord)
      at System.Configuration.BaseConfigurationRecord.GetSectionRecursive(String configKey, Boolean getLkg, Boolean checkPermission, Boolean getRuntimeObject, Boolean requestIsHere, Object& result, Object& resultRuntimeObject)
      at System.Configuration.BaseConfigurationRecord.GetSection(String configKey)
      at System.Configuration.ConfigurationManager.GetSection(String sectionName)
      at System.Configuration.ClientSettingsStore.ReadSettings(String sectionName, Boolean isUserScoped)
      at System.Configuration.LocalFileSettingsProvider.GetPropertyValues(SettingsContext context, SettingsPropertyCollection properties)
      at System.Configuration.SettingsBase.GetPropertiesFromProvider(SettingsProvider provider)
      at System.Configuration.SettingsBase.SetPropertyValueByName(String propertyName, Object propertyValue)
      at System.Configuration.SettingsBase.set_Item(String propertyName, Object value)
      at System.Configuration.ApplicationSettingsBase.set_Item(String propertyName, Object value)
      at Volium.My.MySettings.set_Remember_Settings(Boolean value) in C:\Projects\Volium\Volium\My Project\Settings.Designer.vb:line 137
      at Volium.Form1.CheckBox_Remember_Settings_CheckedChanged(Object sender, EventArgs e) in C:\Projects\Volium\Volium\Form1.vb:line 96
      at System.Windows.Forms.CheckBox.set_CheckState(CheckState value)
      at System.Windows.Forms.CheckBox.OnClick(EventArgs e)
      at System.Windows.Forms.CheckBox.OnMouseUp(MouseEventArgs mevent)
      at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
      at System.Windows.Forms.Control.WndProc(Message& m)
      at System.Windows.Forms.ButtonBase.WndProc(Message& m)
      at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
      at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
      at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData)
      at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
      at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
      at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.OnRun()
      at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.DoApplicationModel()
      at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.Run(String[] commandLine)
      at Volium.My.MyApplication.Main(String[] Args) in 17d14f5c-a337-4978-8281-53493378c1071.vb:line 81
      at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
      at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
      at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
      at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
      at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
      at System.Threading.ThreadHelper.ThreadStart()
 InnerException: System.Configuration.ConfigurationErrorsException
      BareMessage=Unrecognized configuration section userSettings/WindowsApplication1.My.MySettings.
      Filename=C:\Users\Administrador\AppData\Local\Microsoft\Volium.vshost.exe_Url_irr03xswjdrhsokru05hku4eejmnb511\1.0.0.0\user.config
      HResult=-2146232062
      Line=4
      Message=Unrecognized configuration section userSettings/WindowsApplication1.My.MySettings. (C:\Users\Administrador\AppData\Local\Microsoft\Volium.vshost.exe_Url_irr03xswjdrhsokru05hku4eejmnb511\1.0.0.0\user.config line 4)
      Source=System.Configuration
      StackTrace:
           at System.Configuration.ConfigurationSchemaErrors.ThrowIfErrors(Boolean ignoreLocal)
           at System.Configuration.BaseConfigurationRecord.ThrowIfParseErrors(ConfigurationSchemaErrors schemaErrors)
           at System.Configuration.ClientConfigurationSystem.OnConfigRemoved(Object sender, InternalConfigEventArgs e)
      InnerException:
Título: Re: Ayuda con esta excepción! (my.settings)
Publicado por: Eleкtro en 18 Marzo 2013, 18:02 PM
Ya lo he arreglado, lo que pasa es que tenia unas carpetas con el mismo nombre de proyecto en el directorio Roaming, pero el VS debería preveer estas cosas...

Saludos!