Click here to Skip to main content
12,511,383 members (126,762 online)
Rate this:
 
Please Sign up or sign in to vote.
See more: C# generation
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 20-Sep-12 13:52pm
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
Rate this: bad
 
good
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,
—SA
  Permalink  
v2
Rate this: bad
 
good
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();
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.
  Permalink  
v2

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 | Mobile
Web02 | 2.8.160929.1 | Last Updated 21 Sep 2012
Copyright © CodeProject, 1999-2016
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