Note that there are some explanatory texts on larger screens.

plurals
  1. POReturning Assembly Version Numbers from a different application
    primarykey
    data
    text
    <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>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload