473,396 Members | 2,024 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

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
Nov 21 '05 #1
12 1146
http://bernardstudios.com/archive/2004/11/06/387.aspx
"Landley" <ne**@creations-software.co.uk> wrote in message
news:O1**************@TK2MSFTNGP15.phx.gbl...
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

Nov 21 '05 #2
http://bernardstudios.com/archive/2004/11/06/387.aspx
"Landley" <ne**@creations-software.co.uk> wrote in message
news:O1**************@TK2MSFTNGP15.phx.gbl...
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

Nov 21 '05 #3
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?


Assembly.GetName().Version. You can get the Assembly reference with
typeof(SomeClassInTheAssembly).Assembly or
Assembly.GetExecutingAssembly().

Mattias

--
Mattias Sjögren [MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.
Nov 21 '05 #4
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?


Assembly.GetName().Version. You can get the Assembly reference with
typeof(SomeClassInTheAssembly).Assembly or
Assembly.GetExecutingAssembly().

Mattias

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

"David Pope" <dp***@nospam.satx.rr.com> wrote in message
news:uQ*************@TK2MSFTNGP14.phx.gbl...
http://bernardstudios.com/archive/2004/11/06/387.aspx
"Landley" <ne**@creations-software.co.uk> wrote in message
news:O1**************@TK2MSFTNGP15.phx.gbl...
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


Nov 21 '05 #6
Thanks.

"David Pope" <dp***@nospam.satx.rr.com> wrote in message
news:uQ*************@TK2MSFTNGP14.phx.gbl...
http://bernardstudios.com/archive/2004/11/06/387.aspx
"Landley" <ne**@creations-software.co.uk> wrote in message
news:O1**************@TK2MSFTNGP15.phx.gbl...
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


Nov 21 '05 #7
Thanks.

"Mattias Sjögren" <ma********************@mvps.org> wrote in message
news:eS**************@tk2msftngp13.phx.gbl...
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 thatcontains this information. Is there a similar method in windows
services?
Assembly.GetName().Version. You can get the Assembly reference with
typeof(SomeClassInTheAssembly).Assembly or
Assembly.GetExecutingAssembly().

Mattias

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

Nov 21 '05 #8
Thanks.

"Mattias Sjögren" <ma********************@mvps.org> wrote in message
news:eS**************@tk2msftngp13.phx.gbl...
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 thatcontains this information. Is there a similar method in windows
services?
Assembly.GetName().Version. You can get the Assembly reference with
typeof(SomeClassInTheAssembly).Assembly or
Assembly.GetExecutingAssembly().

Mattias

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

Nov 21 '05 #9
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" ?>
<configuration>
<appSettings>
<add key="version" value="1" />
</appSettings>
</configuration>

Then use System.Configuration.ConfigurationSetting.AppSetti ngs property
to retrieve it.
"Landley" wrote:
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

Nov 21 '05 #10
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" ?>
<configuration>
<appSettings>
<add key="version" value="1" />
</appSettings>
</configuration>

Then use System.Configuration.ConfigurationSetting.AppSetti ngs property
to retrieve it.
"Landley" wrote:
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

Nov 21 '05 #11
"Landley" <ne**@creations-software.co.uk> schrieb:
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?


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/>

Nov 21 '05 #12
"Landley" <ne**@creations-software.co.uk> schrieb:
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?


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/>

Nov 21 '05 #13

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Terence Shek | last post by:
Is there a way to set the application binding policy so that it always binds to the latest version of an assembly? I'm hoping there is a way to avoid updating the application's binding...
10
by: Simon Wallis | last post by:
I know the general purpose for the GAC is to share a component among many applications. But even when you add something to the GAC, you still have to manually create a reference to the DLL in your...
2
by: tvaidie | last post by:
Hi all I have two one signing assembly registered in GAC in two different version. I want to remove them but I don't seem able to do so. First I used gacutil.exe, failed with this error...
6
by: James | last post by:
I have two question regarding the version resource that is generated for a satellite assembly. 1) I have a file in my C# console app project called StringResources.en-US.resx. When I build the...
3
by: Michael Bøcker-Larsen | last post by:
Hi I'v been stuck on this problem for ages now. I have found that I'm not the only one with this problem, by looking through the different newsgroups. Hope you can help me! I know there is a...
5
by: mekim | last post by:
Hello....I am trying to System.Reflection.Assembly.GetExecutingAssembly ().GetName ().Version.ToString () ; to display the version of the app...but it remains static and therefore does not...
3
by: Richard Lewis Haggard | last post by:
I'm getting an error that should be easy but I don't understand the info structure well enough to know what's going wrong. I've been slowly adding classes and projects to a solution for a while....
3
by: Richard Lewis Haggard | last post by:
We are having a lot of trouble with problems relating to failures relating to 'The located assembly's manifest definition with name 'xxx' does not match the assembly reference" but none of us here...
2
by: jtyner | last post by:
I am trying to get QFE (Quick Fix Engineering) working with an assembly installed in the GAC. I have two books that claim if two different version of the assembly are installed in the GAC -AND-...
1
by: Coaster | last post by:
orig ref here http://groups.google.com/group/microsoft.public.dotnet.framework.aspnet/browse_thread/thread/ff29cc370678911d/c0db5b7e3da283b9?lnk=st&q=gac+assembly+new+version&rnum=7#c0db5b7e3da283b9...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.