title: Returning Assembly Version Numbers from a different application
body: <p>Let me preface this question by saying I am fairly new to the concept of Assemblies.  I am trying to create a method with in a namespace I have called API. The methods look like this: </p>
  
  <pre><code>Partial Public Class AppInfo
  
      ' This function will return the VersionMajor Element of the Assembly Version
      Function VersionMajor() As String
          Dim txt As String = Assembly.GetExecutingAssembly.GetName.Version.Major.ToString()
          If txt.Length &gt; 0 Then
              Return txt
          Else
              Return String.Empty
          End If
      End Function
  
      ' This function will return the VersionMinor Element of the Assembly Version
      Function VersionMinor() As String
          Dim txt As String = Assembly.GetExecutingAssembly.GetName.Version.Minor.ToString()
          If txt.Length &gt; 0 Then
              Return txt
          Else
              Return String.Empty
          End If
      End Function
  
      ' This function will return the VersionPatch Element of the Assembly Version
      Function VersionPatch() As String
          Dim txt As String = Assembly.GetExecutingAssembly().GetName().Version.Build.ToString()
          If txt.Length &gt; 0 Then
              Return txt
          Else
              Return String.Empty
          End If
      End Function
  
      ' This function will return the entire Version Number of the Assembly Version
      Function Version() As String
          Dim Func As New AppInfo
          Dim txt As String = VersionMajor() + "." + VersionMinor() + "." + VersionPatch()
          If txt.Length &gt; 0 Then
              Return txt
          Else
              Return String.Empty
          End If
      End Function
  
  End Class
  </code></pre>
  
  <p>I have other projects within the same solution that call the API as an additional reference.  What I'd like to accomplish is say I have a project that references the API project called Test.  In the home controller of test I have a view data that calls the Version method. Like this:</p>
  
  <pre><code>Function Index() As ActionResult
    Dim func As New API.AppInfo
    ViewData("1") = func.Version
    Return View()
  End Function
  </code></pre>
  
  <p>I'd like the viewdata to return the Version number of the Test assembly, but instead this returns the API Assembly version. What am I doing wrong here?</p>