0

i have been searching on how to fix this error. I have just changed my application to use a .Settings file. I have just tried to run it in debug mode and it seems to throw and unhandled exception in the ShopSettings.Designer.cs.

enter image description here

Most of the answers to other questions talk about the Config file which every answer i have tried doesn't change anything.

enter image description here

This happens when the application is first loaded... Even so that the application can't throw an unhandled exception if i run it outside the debug mode.

Thanks in Advance, and if there is anything else that is required for an answer. Please comment and I will get back ASAP.

Update

Here is the View Details screen. (Red marks for security reasons)

enter image description here

enter image description here

All of the errors that i have when id debug to when the ServerName is first used of which is where it throws the error

Brendon
  • 334
  • 1
  • 2
  • 14
  • 1
    Probably the problem is, that you have defined two sections with different names, but the same reference. I guess the system can not handle this. Do you have any Inner Exceptions for this unhandled exception? – Stefan Kert Aug 18 '16 at 09:52
  • I have just tried commenting them out (not all but the ones i weren't using) and then running it and i have the same issue... inner Exceptions? – Brendon Aug 18 '16 at 09:56
  • In your exception dialog go to "View Details." Probably there is further information included. Another possibility would be to add an Global Unhandeld Exception handler and grab the exception on the fly [Exception Handling](http://stackoverflow.com/a/3133249/6641105) – Stefan Kert Aug 18 '16 at 09:58
  • Added it to the question – Brendon Aug 18 '16 at 10:03

2 Answers2

1

The problem is your SectionGroup userSettings. If you delete this section everything should work pretty good.

You have defined to sectiongroups:

  • userSettings
  • userShopSettings

But you only have declared the information for userShopSettings.

Stefan Kert
  • 587
  • 4
  • 9
  • I did that as part of your comment. Nothing changed :/ Thanks anyway – Brendon Aug 18 '16 at 10:11
  • Have you tried changing the name of your tag from to and also renaming the sectiongroup? – Stefan Kert Aug 18 '16 at 10:13
  • Sorry, that doesn't work either. I am just about to add something to the question that might help – Brendon Aug 18 '16 at 10:17
  • So you have changed all namings from usershopsettings to usersettings, removed the duplicate entries from the app.config, making a complete rebuild of the solution and it still doesn´t work? – Stefan Kert Aug 18 '16 at 11:23
  • I changed the name of the settings file - Rebuild and it worked... i have marked your answer as correct because i dont think i did a rebuild. Thanks for the help because i think you were the one to actually find the answer it was just me not rebuilding the application which may have not done anything – Brendon Aug 18 '16 at 11:26
  • np. Regarding your problem with release mode. Probably you should switch to release and make a complete rebuild. I guess this will do the trick. Otherwise please checkup your Settings files if you are in release mode, because maybe they differ from the actual file in debug mode. – Stefan Kert Aug 18 '16 at 11:27
  • That still only allows me to run it in debug mode... not too much of an issue so i wouldn't worry too much – Brendon Aug 18 '16 at 11:30
0

I managed to fix the issue... not 100% how but what i did was change the name to ServerConfig and and it worked... The only thing is that i can only run the application in Debug mode. If anyone can figure out the reason as to how this worked then please let me know. Thanks in advance.

Here is what my app.config file now looks like (for anyone interested).

enter image description here

Brendon
  • 334
  • 1
  • 2
  • 14