Assembly version number

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Landley

    Assembly version number

    Hello All,

    I am writing a windows service and wish to retrieve the version number of
    the assembly. In a windows application, there is the Application class that
    contains this information. Is there a similar method in windows services?

    Landley


  • David Pope

    #2
    Re: Assembly version number




    "Landley" <news@creatio ns-software.co.uk> wrote in message
    news:O165aBK3EH A.4008@TK2MSFTN GP15.phx.gbl...[color=blue]
    > Hello All,
    >
    > I am writing a windows service and wish to retrieve the version number of
    > the assembly. In a windows application, there is the Application class
    > that
    > contains this information. Is there a similar method in windows services?
    >
    > Landley
    >
    >[/color]


    Comment

    • Mattias Sjögren

      #3
      Re: Assembly version number

      [color=blue]
      >I am writing a windows service and wish to retrieve the version number of
      >the assembly. In a windows application, there is the Application class that
      >contains this information. Is there a similar method in windows services?[/color]

      Assembly.GetNam e().Version. You can get the Assembly reference with
      typeof(SomeClas sInTheAssembly) .Assembly or
      Assembly.GetExe cutingAssembly( ).



      Mattias

      --
      Mattias Sjögren [MVP] mattias @ mvps.org
      http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
      Please reply only to the newsgroup.

      Comment

      • Landley

        #4
        Re: Assembly version number

        Thanks.

        "David Pope" <dpope@nospam.s atx.rr.com> wrote in message
        news:uQ7WSSK3EH A.924@TK2MSFTNG P14.phx.gbl...[color=blue]
        > http://bernardstudios.com/archive/2004/11/06/387.aspx
        >
        >
        > "Landley" <news@creatio ns-software.co.uk> wrote in message
        > news:O165aBK3EH A.4008@TK2MSFTN GP15.phx.gbl...[color=green]
        > > Hello All,
        > >
        > > I am writing a windows service and wish to retrieve the version number[/color][/color]
        of[color=blue][color=green]
        > > the assembly. In a windows application, there is the Application class
        > > that
        > > contains this information. Is there a similar method in windows[/color][/color]
        services?[color=blue][color=green]
        > >
        > > Landley
        > >
        > >[/color]
        >
        >[/color]


        Comment

        • Landley

          #5
          Re: Assembly version number

          Thanks.

          "Mattias Sjögren" <mattias.dont.w ant.spam@mvps.o rg> wrote in message
          news:eSBdHTK3EH A.4064@tk2msftn gp13.phx.gbl...[color=blue]
          >[color=green]
          > >I am writing a windows service and wish to retrieve the version number of
          > >the assembly. In a windows application, there is the Application class[/color][/color]
          that[color=blue][color=green]
          > >contains this information. Is there a similar method in windows[/color][/color]
          services?[color=blue]
          >
          > Assembly.GetNam e().Version. You can get the Assembly reference with
          > typeof(SomeClas sInTheAssembly) .Assembly or
          > Assembly.GetExe cutingAssembly( ).
          >
          >
          >
          > Mattias
          >
          > --
          > Mattias Sjögren [MVP] mattias @ mvps.org
          > http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
          > Please reply only to the newsgroup.[/color]


          Comment

          • Ben Solomon

            #6
            RE: Assembly version number

            You might want to define the version of your service in App.config
            as a key/value pair like:

            <?xml version="1.0" encoding="utf-8" ?>
            <configuratio n>
            <appSettings>
            <add key="version" value="1" />
            </appSettings>
            </configuration>

            Then use System.Configur ation.Configura tionSetting.App Settings property
            to retrieve it.


            "Landley" wrote:
            [color=blue]
            > Hello All,
            >
            > I am writing a windows service and wish to retrieve the version number of
            > the assembly. In a windows application, there is the Application class that
            > contains this information. Is there a similar method in windows services?
            >
            > Landley
            >
            >
            >[/color]

            Comment

            • Herfried K. Wagner [MVP]

              #7
              Re: Assembly version number

              "Landley" <news@creatio ns-software.co.uk> schrieb:[color=blue]
              > I am writing a windows service and wish to retrieve the version number of
              > the assembly. In a windows application, there is the Application class
              > that
              > contains this information. Is there a similar method in windows services?[/color]

              Structure of version numbers and methods to determine the version number
              <URL:http://dotnet.mvps.org/dotnet/faqs/?id=versioning& lang=en>

              --
              M S Herfried K. Wagner
              M V P <URL:http://dotnet.mvps.org/>
              V B <URL:http://dotnet.mvps.org/dotnet/faqs/>

              Comment

              Working...