473,325 Members | 2,792 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,325 software developers and data experts.

Assembly Version Madness

Should be trivial - I want to detect the program version so that I can
take steps to update things to the current version. Pretty simple - just use

Application.ProductVersion

So I install the app on a file server. Various workstations then load the
app and run it. Some workstations are Win98, some are XP. To enable users to
access the program, I share the folder on the server. When my customers
share a folder, the folder name on the server may be "Server Folder Name".
The default is to give the shared folder the same name, you then give the
workstation users the necessary permissions.

When you load the exe from an XP workstation, Application.ProductVersion
returns the correct version and so does Windows Explorer when you browse to
the server folder and do a File, Properties on the exe.

On a Win98 workstation, Application.ProductVersion returns version 1
regardless of what version the exe really is. So you then use Windows
Explorer on the 98 computer, browse to the exe on the server, do a File,
Properties on the exe, and there is NO version tab - Unbelievable.

Then just change the share name from "Server Folder Name" to say
"SFolder". Then when you do a File, Properties on the exe from a Win98
computer, there is now a Version tab, and Application.ProductVersion returns
the correct value.

Why would the share name of a folder totally kill the ability of Windows
explorer to display a Version tab and make Application.ProductVersion return
an incorrect value.

This can't possibly be by design (I hope). Anybody else run into this or
have any suggestions on how to make Application.ProductVersion work reliably
on a Win98 computer.

Thanks
Russ Stevens
Jul 21 '05 #1
12 1996
Russell Stevens wrote:
Should be trivial - I want to detect the program version so that I can
take steps to update things to the current version. Pretty simple - just use

Application.ProductVersion


Not that I can help you, but whenever I try to call that line in my code
I get an error (null reference I think.) I've never been able to do
something like
(assuming myversion is a label on my form)

myversion.text = application.productversion

It always bombs.

Rinze van Huizen
Jul 21 '05 #2
Rinze,

Application.Product version returns a string such as

2.25.5.0 (you can specify the version in your AssemblyInfo.vb file)

If you want the major, minor version, etc. you need to parse it out.

Russ
Jul 21 '05 #3
Russell Stevens wrote:
Rinze,

Application.Product version returns a string such as

2.25.5.0 (you can specify the version in your AssemblyInfo.vb file)

If you want the major, minor version, etc. you need to parse it out.

Russ

If only I got that back :( Whenever I call Application.ProductVersion I
get this error:

"An unhandled exception of type 'System.NullReferenceException' occured
in System.Windows.Forms.dll

Additional information: object reference not set to an instance of an
object."

So somehow my appliction object points to nothing it seems.

Same error if I try something like Application.ProductName. Doesn't
matter if I assign it to a var, textbox or a msgbox.

Rinze van Huizen
Jul 21 '05 #4
Anyone from Microsoft hang out in this forum?

Microsoft directed me to come to this forum for this issue.

Or perhaps I misunderstood what the following means?

"A commitment to respond to your post within two business days?"

Thanks
Russ Stevens
Jul 21 '05 #5
"Russell Stevens" <ra*******@aol.com> wrote in message news:<OC**************@TK2MSFTNGP14.phx.gbl>...
Anyone from Microsoft hang out in this forum?

Microsoft directed me to come to this forum for this issue.

Or perhaps I misunderstood what the following means?

"A commitment to respond to your post within two business days?"


Newsgroups are a good source of information and halp between users,
but it is not an official support path of MS. There is no commitment
whatsoever in newsgroups, only good wolling people searching to help
one each other.

Arnaud
MVP - VC
Jul 21 '05 #6
Arnaud,

Ref:<<Newsgroups are a good source of information and halp between users,
but it is not an official support path of MS. There is no commitment
whatsoever in newsgroups, only good wolling people searching to help
one each other>>

REALLY?

Could you then explain the following direct quote from the Microsoft MSDN
subscriptions site.
*******************
"About Managed Newsgroups
MSDN managed newsgroups are available in English to MSDN Universal,
Enterprise, Professional and Operating Systems subscribers to receive free
technical support on select Microsoft technologies as well as to share ideas
with other subscribers. MSDN managed newsgroups provide:

Unlimited on-line technical support - keep your PSS incidents
A commitment to respond to your post within two business days
Over 200 newsgroups to choose from
Spam protection for your e-mail address when posting items"
******************
Are you speaking for Microsoft? or what? There was a response, but it had
nothing to do with the question at hand!

I could use a tech support incident but this problem is so blatently obvious
that a Microsoft support engineer working on another tech support incident
suggested that I come here - geesh.

If no one from Microsoft is going to review my post then someone at
Microsoft needs to revise their official stated policy.

Thanks
Russ Stevens
Jul 21 '05 #7
"Russell Stevens" <ra*******@aol.com> wrote in message news:<uc**************@TK2MSFTNGP11.phx.gbl>...
Arnaud,

Ref:<<Newsgroups are a good source of information and halp between users,
but it is not an official support path of MS. There is no commitment
whatsoever in newsgroups, only good wolling people searching to help
one each other>>

REALLY?

Could you then explain the following direct quote from the Microsoft MSDN
subscriptions site.
*******************
"About Managed Newsgroups
MSDN managed newsgroups are available in English to

<snip>
This is NOT an MSDN managed newsgroup, sorry. This is a public MS
group accessible to everybody, noy only MSDN subscribers.

Arnaud
MVP - VC
Jul 21 '05 #8
Arnaud,

You are starting to annoy me

ref <<This is NOT an MSDN managed newsgroup, sorry. This is a public MS
group accessible to everybody, noy only MSDN subscribers.>>

Please go to

http://msdn.microsoft.com/newsgroups/managed/

then in the Search For box enter "Assembly Version" and search in MSDN
Managed Newsgroups.

Voila - you will find this thread IS IN a Microsoft Managed Newsgroup.

Now perhaps I don't know how to submit my question correctly, and if you are
an MVP, then it would be appreciated it you would tell me how. But according
to Microsoft, this IS a managed newsgroup and I would sure like some help
instead of wise a** comments.

I give MS thousands of dollars every year for MSDN subscriptions - they
promise me 2 business day newsgroup replies. All I am getting is a bunch of
BULL.

Please take this up your chain until you find someone that can resolve how I
am supposed to get the promised 2 day response.

Thanks
Russell Stevens
Jul 21 '05 #9
Arnaud,

You are starting to annoy me

ref <<This is NOT an MSDN managed newsgroup, sorry. This is a public MS
group accessible to everybody, noy only MSDN subscribers.>>

Please go to

http://msdn.microsoft.com/newsgroups/managed/

then in the Search For box enter "Assembly Version" and search in MSDN
Managed Newsgroups.

Voila - you will find this thread IS IN a Microsoft Managed Newsgroup.

Now perhaps I don't know how to submit my question correctly, and if you are
an MVP, then it would be appreciated it you would tell me how. But according
to Microsoft, this IS a managed newsgroup and I would sure like some help
instead of wise a** comments.

I give MS thousands of dollars every year for MSDN subscriptions - they
promise me 2 business day newsgroup replies. All I am getting is a bunch of
BULL.

Please take this up your chain until you find someone that can resolve how I
am supposed to get the promised 2 day response.

Thanks
Russell Stevens
"Arnaud Debaene" wrote:
"Russell Stevens" <ra*******@aol.com> wrote in message news:<uc**************@TK2MSFTNGP11.phx.gbl>...
Arnaud,

Ref:<<Newsgroups are a good source of information and halp between users,
but it is not an official support path of MS. There is no commitment
whatsoever in newsgroups, only good wolling people searching to help
one each other>>

REALLY?

Could you then explain the following direct quote from the Microsoft MSDN
subscriptions site.
*******************
"About Managed Newsgroups
MSDN managed newsgroups are available in English to

<snip>
This is NOT an MSDN managed newsgroup, sorry. This is a public MS
group accessible to everybody, noy only MSDN subscribers.

Arnaud
MVP - VC

Jul 21 '05 #10
Try something like this:

Assembly.GetCallingAssembly().GetName().Version

[
or Assembly.GetExecutingAssembly()
or Assembly.GetAssembly(typeof(your_type_you_want_to_ check)) -
to get an instance of Assembly class
]

using a Version class in conjuction with Assembly class you can easily
determine your(any) assembly version: .exe or .dll
--
Dariusz Rajtak

"Russell Stevens" wrote:
Should be trivial - I want to detect the program version so that I can
take steps to update things to the current version. Pretty simple - just use

Application.ProductVersion

So I install the app on a file server. Various workstations then load the
app and run it. Some workstations are Win98, some are XP. To enable users to
access the program, I share the folder on the server. When my customers
share a folder, the folder name on the server may be "Server Folder Name".
The default is to give the shared folder the same name, you then give the
workstation users the necessary permissions.

When you load the exe from an XP workstation, Application.ProductVersion
returns the correct version and so does Windows Explorer when you browse to
the server folder and do a File, Properties on the exe.

On a Win98 workstation, Application.ProductVersion returns version 1
regardless of what version the exe really is. So you then use Windows
Explorer on the 98 computer, browse to the exe on the server, do a File,
Properties on the exe, and there is NO version tab - Unbelievable.

Then just change the share name from "Server Folder Name" to say
"SFolder". Then when you do a File, Properties on the exe from a Win98
computer, there is now a Version tab, and Application.ProductVersion returns
the correct value.

Why would the share name of a folder totally kill the ability of Windows
explorer to display a Version tab and make Application.ProductVersion return
an incorrect value.

This can't possibly be by design (I hope). Anybody else run into this or
have any suggestions on how to make Application.ProductVersion work reliably
on a Win98 computer.

Thanks
Russ Stevens

Jul 21 '05 #11
Dariusz,

From what I can tell

Application.ProductVersion

is broke when used to determine the version of an assembly in a shared
folder that has a long share name when the app is running on a Win98 box.
Additionally, the ability to get the version from Windows Explorer is also
broke. Both of these work if the share name is changed to a short name with
no spaces.

System.Reflection.Assembly.GetExecutingAssembly(). GetName.Version.ToString

works regardless of the name of the shared folder even when run on a Win98
box. I am not sure what else might be broke with the Application object -
Application.ProductName seems to work. This sure looks like a MS bug to me.

Thanks
Russell Stevens
Jul 21 '05 #12
Russell,

I am agree with you what it is a bug. I thought you are looking for
workaround for this problem, so I wrote my idea for retrieving a valid
version of assembly. I don't know if MS knows about it, maybe furums are
periodically searched by their personel for such types of bugs we writing
about. Maybe in next service pack they correct this annoying behaviour.
Summing up, I fully agree that Application.ProductVersion is not working as
anyone can expect.

--
Dariusz Rajtak
Jul 21 '05 #13

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

Similar topics

3
by: news.microsoft.com | last post by:
Hi, I know how to retrieve the Assembly Version for a WinForm program : Application.ProductVersion. But how to do it for a windows service in C# ??? Thx for your help G.
1
by: Robbie from Philippines | last post by:
how do i read the assembly version (not the file version) of ? tnx..
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...
13
by: Russell Stevens | last post by:
Should be trivial - I want to detect the program version so that I can take steps to update things to the current version. Pretty simple - just use Application.ProductVersion So I install the...
1
by: Lucvdv | last post by:
In my assembly.vb files, I'm using the revision/build wildcard style: <Assembly: AssemblyVersion("3.0.*")> <Assembly: AssemblyFileVersion("3.0.*")> This onkly seems to work in projects that...
6
by: Zytan | last post by:
In the Assembly Information, you can set the assembly version and the file version. What is the difference between the two? The documentation is not exactly helpful in this area. I had the...
4
by: Bob Altman | last post by:
Hi all, I have a C++/CLI project (VS 2005) that produces a DLL that exports C bindings. Internally, this DLL contains routines compiled with /clr. I notice that my DLL doesn't have a version...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.