VB.NET Writing a custom type for My.Settings

I have implemented a class that inherits the CollectionBase class.  I want to store this class/type using the My.Settings feature of VB.NET.  I am able to add the setting and select my registered type, however when I startup my project, I get an error: Configuration system filed to initialize.

Below is my custom type code.
Namespace SiteLists
 
    <Serializable()> _
    Public Class SiteListCollection
        Inherits CollectionBase
 
        Default Public ReadOnly Property Item(ByVal index As Integer) As SiteList
            Get
                Return DirectCast(List(index), SiteList)
            End Get
        End Property
 
        Public Sub Add(ByVal siteList As SiteList)
            List.Add(siteList)
        End Sub
 
        Public Sub Remove(ByVal siteList As SiteList)
            List.Remove(siteList)
        End Sub
    End Class
 
    <Serializable()> _
    Public Class SiteList
        Private _Name As String
        Private _Url As String
 
        Public Property Name() As String
            Get
                Return _Name
            End Get
            Set(ByVal value As String)
                _Name = value
            End Set
        End Property
 
        Public Property Url() As String
            Get
                Return _Url
            End Get
            Set(ByVal value As String)
                _Url = value
            End Set
        End Property
 
        Public Sub New(ByVal ListName As String, ByVal ListUrl As String)
            _Name = ListName
            _Url = ListUrl
        End Sub
    End Class
 
End Namespace

Open in new window

sr2007Asked:
Who is Participating?
 
Kevin RobinsonConnect With a Mentor Private VB.NET ContractorCommented:
The "Configuration system filed to initialize" error has nothing to do with your code.  It is related to the LOCAL PC. I have developed a system that works on very many remote computers but a few give this error.  It is more to do with some windows security.  There are some documented resolutions to this but NONE worked for me.
0
 
sr2007Author Commented:
Yes, I have seen these articles.  No help.  Sorry.
0
 
CodeCruiserCommented:
This is not exactly what you have asked for but may be useful

http://www.codeproject.com/KB/vb/myextensions.aspx
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.