BC30068: Expression is a value and therefore cannot be the target of an assignment
<p>I've ran into a problem when transfering some code from dev server to live server.</p>

<p>It is working in Dev but not on Live..</p>

<p>The error occurs here:</p>

<pre><code>personList.Add(New Person() With {.ID = reader("user_id"), .Name = reader("person")})
</code></pre>

<p>and the error message is: Expression is a value and therefore cannot be the target of an assignment.</p>

<p>Code behind:</p>

<pre><code>Public Class Person
    Private m_ID As Integer
    Public Property ID() As Integer
        Get
            Return m_ID
        End Get
        Set(ByVal value As Integer)
            m_ID = value
        End Set
End Property
Private m_Name As String
Public Property Name() As String
    Get
        Return m_Name
    End Get
    Set(ByVal value As String)
        m_Name = value
    End Set
End Property

Public Sub New()
End Sub

Public Function GetPersonList(ByVal tryvalue As String, ByVal is_cust As Integer) As List(Of Person)

    Dim personList As New List(Of Person)()

    Dim sqlCommand As New SqlCommand()
    Dim connectionString As String = ConfigurationManager.ConnectionStrings("scConnString").ConnectionString
    Dim command As New SqlCommand
    Dim reader As SqlDataReader
    Dim org_id = HttpContext.Current.Session("org_id")
    Dim strName As String = ""
    Dim nID As Integer = 0

    Dim loadNameSQL As String = "SELECT distinct top 10 user_id, firstname + ' ' + lastname as person FROM users  WHERE " &amp; _
   "firstname + ' ' + lastname like @tryvalue and org_id = @org_id and delete_flag=0"

    sqlCommand.Parameters.AddWithValue("tryValue", tryvalue + "%")
    sqlCommand.Parameters.AddWithValue("org_id", org_id)

    Dim sqlConnection As New SqlConnection(connectionString)

    Try
        sqlConnection.Open()
        sqlCommand.CommandText = loadNameSQL
        sqlCommand.Connection = sqlConnection
        reader = sqlCommand.ExecuteReader()

        Do While reader.Read()
            personList.Add(New Person() With {.ID = reader("user_id"), .Name = reader("person")})
        Loop
        reader.Close()
    Catch ex As Exception

    Finally
        sqlConnection.Close()
    End Try

    Return personList
End Function
</code></pre>

<p>End Class</p>

<p>Any ideas?</p>

<p>Thanks,</p>
