Click here to Skip to main content
13,140,591 members (47,278 online)
Rate this:
Please Sign up or sign in to vote.
See more:
Any time I make any changes to the GUI I get the following error:[^]
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:[^]

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.


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 20-Sep-12 13:52pm
Updated 20-Sep-12 15:43pm
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.
Rate this: bad
Please Sign up or sign in to vote.

Solution 1

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,
Rate this: bad
Please Sign up or sign in to vote.

Solution 2

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.
var portableSettingsProvider = new 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.

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

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy |
Web01 | 2.8.170915.1 | Last Updated 21 Sep 2012
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100