473,503 Members | 9,735 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1149
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
8760
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
504
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
5750
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
3164
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
12159
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
3581
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
2544
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
4384
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
2174
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
2238
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
7294
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
7361
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...
1
7015
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7470
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5602
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
4693
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3183
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
1
749
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
403
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.