C# application version

C

Cyrus

Version ver = new Version(System.Windows.Forms.Application.ProductVersion);

i use the above method to get the version of the application
however it works in a vb.net code
but not c# code
it throws a nullreference exception
what's wrong
 
M

Martin Stainsby

Cyrus said:
Version ver = new Version(System.Windows.Forms.Application.ProductVersion);

i use the above method to get the version of the application
however it works in a vb.net code
but not c# code
it throws a nullreference exception
what's wrong

Works fine in my C#.
 
H

Herfried K. Wagner [MVP]

* "Cyrus said:
Version ver = new Version(System.Windows.Forms.Application.ProductVersion);

i use the above method to get the version of the application
however it works in a vb.net code
but not c# code
it throws a nullreference exception
what's wrong

Are you really sure _this_ line throws the exception? What does
'Application.ProductVersion' return in your case?

--
Herfried K. Wagner
MVP · VB Classic, VB.NET
<http://www.mvps.org/dotnet>

<http://www.plig.net/nnq/nquote.html>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top