Asp.net 类型的值。。。无法转换为

Asp.net 类型的值。。。无法转换为,asp.net,vb.net,Asp.net,Vb.net,每当我尝试运行代码时,我总是收到以下错误。有什么建议可能导致我无法转换?似乎这两种类型都是一样的,所以我对这一点有点困惑 Value of type 'System.Collections.Generic.List(Of CVE)' cannot be converted to 'System.Collections.Generic.List(Of CVE)' 此处发生错误: Dim cveList As List(Of CVE) cveList = CVERepository.GetInst

每当我尝试运行代码时,我总是收到以下错误。有什么建议可能导致我无法转换?似乎这两种类型都是一样的,所以我对这一点有点困惑

Value of type 'System.Collections.Generic.List(Of CVE)' cannot be converted to 'System.Collections.Generic.List(Of CVE)'
此处发生错误:

Dim cveList As List(Of CVE)
cveList = CVERepository.GetInstance.ReadAllCVEs
以下是CVE假设类:

Public Class CVERepository

Private Sub New()

End Sub

Public Shared ReadOnly Property GetInstance As CVERepository
    Get
        Static Instance As CVERepository = New CVERepository
        Return Instance
    End Get
End Property

Public Function ReadAllCVEs() As List(Of CVE)
    Dim objAdapter As OleDb.OleDbDataAdapter
    Dim dtCVE As New DataTable()
    Dim strSQL As String
    Dim strConn As String
    Dim dvCVE As DataView

    strConn = ConnectStringBuild()
    strSQL = "Select * From CVE"

    objAdapter = New OleDb.OleDbDataAdapter(strSQL, strConn)
    objAdapter.Fill(dtCVE)
    dvCVE = dtCVE.DefaultView
    Dim cveList As New List(Of CVE)

    'Put it into an object list to make it more managable.
    For index = 0 To dvCVE.Count - 1
        Dim cve As New CVE
        cve.ID = dvCVE(index)("CVEID")
        cve.PublishedDate = dvCVE(index)("PublishedDate")
        cve.Availability = dvCVE(index)("Availability")
        cve.CVSSScore = dvCVE(index)("CVSSScore")
        cve.Confidentiality = dvCVE(index)("Confidentiality")
        cve.Integrity = dvCVE(index)("Integrity")
        cve.Summary = dvCVE(index)("Summary")
        cveList.Add(cve)
    Next

    Return cveList

End Function

Public Shared Function ConnectStringBuild() As String
    'Grabbing connection string from web.config
    Return System.Configuration.ConfigurationManager.ConnectionStrings("CVEConnectionString").ConnectionString
End Function

End Class
关于这个错误有什么建议吗?

只是一点小小的改变

Dim cveList As List(Of CVE)
cveList.AddRange(CVERepository.GetInstance.ReadAllCVEs)

你看到了吗?安德鲁-你是对的。我使用ASP.net创建了一个CVE.aspx页面,该页面自动创建了一个CVE对象。因此,我之前创建的CVE类产生了冲突。