Click here to Skip to main content
15,888,461 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Any time I make any changes to the GUI I get the following error: http://puu.sh/173Iq[^]
A long with that all the items on my toolbar (only the toolbar is affected) disappear when I run the program, it doesn't matter where I change the GUI.

I am using the C# code from the following article: Creating a Custom Settings Provider[^]

Here is the C# code: http://pastebin.com/EYBKceib[^]

I followed the instructions in the article, but now with any change to the GUI I get the error listed at the beginning. If I remove PortableSettingsProvider as the provider the error goes away, but I would like to figure out why it is causing this problem and how I can fix while retaining the portable settings.

EDIT

CodeProject doesn't seem to be letting me reply to any answers or comments so I will just have to here.
What happens is, I put PortableSettingsProvider as the Provider for Settings.settings. Once I do that, any changes I make to the GUI wipe the items on my Toolbar and when I save the file I get the error posted at the top. That is the only thing VS2012 gives me, no line of error, no stacktrace, just that small little message.

When I remove PortableSettingsProvider as the Provider I don't have any problems, but when it is there it causes problems, I honestly have no idea what could be causing it as the message is the only error it gives me.
Posted
Updated 20-Sep-12 15:43pm
v3
Comments
Sergey Alexandrovich Kryukov 20-Sep-12 20:41pm    
Not enough information. Your code is incomplete as I could not see the entry point. If you could provide short but complete code sample focusing on just one problem, it could help. If you can, use "Improve question" above.
--SA

The bitmap is a strange way to provide the error information. Anyway, this is what it is: you might not reference the assembly in question. Find out what is it and where it comes from.

I would suggest you address the author of the article you used. Load the article text, locate the section "Comments and Discussions" at the end and click "Add a Comment or Question" to add your question. The author get the notification of your post and a chance to reply.

Good luck,
—SA
 
Share this answer
 
v2
For anyone who is intersted I found out the the problem seems to be with having the toolbar and the the Provider, remove one and the problem is fine, add one and the issue is there. I don't know why.

However I found a workaround for the issue. You can get around it by doing the following.
C#
var portableSettingsProvider = new PortableSettingsProvider();
Properties.Settings.Default.Providers.Add(portableSettingsProvider);
foreach (SettingsProperty property in Properties.Settings.Default.Properties)
{
    property.Provider = portableSettingsProvider;
}
In your Main() before you application is ran.

If anyone know WHY those two have a problem with each other I would love to know.
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900