Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. .NET (Core and Framework)
  4. Get Version Number.

Get Version Number.

Scheduled Pinned Locked Moved .NET (Core and Framework)
csharpcomhelpquestionannouncement
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    J Offline
    Jason Weibel
    wrote on last edited by
    #1

    I have designed a .Net web service and the client is requesting a new web method to return the web service version number? My web service code consists of the following: <WebMethod(Description:="Get Web Service Version Number.")> _ Public Function GetVersion() As String Dim sValue As String sValue = System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.ToString() Return sValue End Function The problem is this returns “0.0.0.0”. I have tried the following in the assembily.vb file with no luck: '<Assembly: AssemblyVersion("1.0.*")> <Assembly: AssemblyVersion("*")> Can anyone tell me what I’m doing wrong. Thanks, Jason W.

    J 1 Reply Last reply
    0
    • J Jason Weibel

      I have designed a .Net web service and the client is requesting a new web method to return the web service version number? My web service code consists of the following: <WebMethod(Description:="Get Web Service Version Number.")> _ Public Function GetVersion() As String Dim sValue As String sValue = System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.ToString() Return sValue End Function The problem is this returns “0.0.0.0”. I have tried the following in the assembily.vb file with no luck: '<Assembly: AssemblyVersion("1.0.*")> <Assembly: AssemblyVersion("*")> Can anyone tell me what I’m doing wrong. Thanks, Jason W.

      J Offline
      J Offline
      John Arlen
      wrote on last edited by
      #2

      The code you have should work perfectly. AssemblyVersion("*") isn't valid however. I actually got a compiler error when I tried to use it. The asterisk in the default tells the compiler to automatically increment the version as you build.. 1.0.4.3333 1.0.4.3334 ...etc... Use AssemblyVersion("1.0.*") or specify the full version ("1.0.0.0") If you debug your web service, do you also see 0.0.0.0 returned to string sValue?

      J 1 Reply Last reply
      0
      • J John Arlen

        The code you have should work perfectly. AssemblyVersion("*") isn't valid however. I actually got a compiler error when I tried to use it. The asterisk in the default tells the compiler to automatically increment the version as you build.. 1.0.4.3333 1.0.4.3334 ...etc... Use AssemblyVersion("1.0.*") or specify the full version ("1.0.0.0") If you debug your web service, do you also see 0.0.0.0 returned to string sValue?

        J Offline
        J Offline
        Jason Weibel
        wrote on last edited by
        #3

        Now why didn’t that work the other day? It works now. Thanks for the help. Jason W.

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups