Matt
Matt

Reputation: 172

Error on Load Event when using My.Settings

I am currently having an issue with the usage of embedded settings in my application. I intend to use them with the form load/closing event, but I am recieving an error like this user:

Error when loading mySettings [Visual basics 2010]

I looked at my settings.vb file and everything appears to be in order, but I am not really sure what could have become incorrect/corrupt because it is all generated when I make changes to the project properties. In order to check if my usage of the settings was correct I created a new project with:

Private Sub Load()
     Textbox1.Text = My.Settings.Test
End Sub

Private Sub Close()
     My.Settings.Test = TextBox1.Text
End Sub

Everything is working perfectly in the new project, so the error is isolated to my particular project. Has anyone encountered this or have any ideas on how to remedy it?

Thanks for any help!

Exact Same Error from another user: Found this Image on Dream in Code.

Upvotes: 0

Views: 643

Answers (1)

Matt
Matt

Reputation: 172

For those people googling this in the future here is the solution in my case: Click View Detail and continue navigation through the error detail until you find the path to the app.config file. Once you find it move it to a backup location and run your app again. The file will be regenerated correctly.

Upvotes: 1

Related Questions