Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Exception when accessing Properties.Settings

Exception when accessing Properties.Settings

Scheduled Pinned Locked Moved C#
cssdatabasehelpquestionworkspace
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • B Offline
    B Offline
    buchstaben
    wrote on last edited by
    #1

    Hi, my application runs some code in each interval. There the first line looks like int sec = Settings.Default.Intervall; in my case, the interval setting doesn't change and holds a value of 20, so every 20 seconds Settings.Default.Intervall; is accessed. the problem is, that sometimes an exception occurs. this happens once a week or so. any idea what the point could be? FATAL 02.08.08 06:07:52 [ thrCounter]: Ein unbehandelter Fehler ist aufgetreten (sender: Name:Umm.exe There are no context policies. , exception: System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index at System.Collections.ArrayList.get_Item(Int32 index) at System.Configuration.SettingsPropertyValueCollection.get_Item(String name) at System.Configuration.ApplicationSettingsBase.GetPropertyValue(String propertyName) at System.Configuration.ApplicationSettingsBase.get_Item(String propertyName) at Umm.Properties.Settings.get_Intervall() in D:\VSSTools\Umm\Entwicklung\Properties\Settings.Designer.cs:line 31 at Umm.App.Controler.runIntervallWaiting() in D:\VSSTools\Umm\Entwicklung\App\Controler.cs:line 213

    G 1 Reply Last reply
    0
    • B buchstaben

      Hi, my application runs some code in each interval. There the first line looks like int sec = Settings.Default.Intervall; in my case, the interval setting doesn't change and holds a value of 20, so every 20 seconds Settings.Default.Intervall; is accessed. the problem is, that sometimes an exception occurs. this happens once a week or so. any idea what the point could be? FATAL 02.08.08 06:07:52 [ thrCounter]: Ein unbehandelter Fehler ist aufgetreten (sender: Name:Umm.exe There are no context policies. , exception: System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index at System.Collections.ArrayList.get_Item(Int32 index) at System.Configuration.SettingsPropertyValueCollection.get_Item(String name) at System.Configuration.ApplicationSettingsBase.GetPropertyValue(String propertyName) at System.Configuration.ApplicationSettingsBase.get_Item(String propertyName) at Umm.Properties.Settings.get_Intervall() in D:\VSSTools\Umm\Entwicklung\Properties\Settings.Designer.cs:line 31 at Umm.App.Controler.runIntervallWaiting() in D:\VSSTools\Umm\Entwicklung\App\Controler.cs:line 213

      G Offline
      G Offline
      Guffa
      wrote on last edited by
      #2

      It looks like your SettingsPropertyValueCollection is getting corrupted, so that the values in the _Indices HashTable doesn't correspond to the size of the _Values ArrayList. The class itself should be pretty well tested, so there might be something in your code that is accessing some memory that it shouldn't. Typically that's only possible when using reflection, unsafe code blocks or calls to unmanaged code.

      Despite everything, the person most likely to be fooling you next is yourself.

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups