2

I can see the 140 in my csproj file. How do I read and display this number in my application.

I tried System.Deployment.Application.ApplicationDeployment.CurrentDeployment.CurrentVersion.ToString()

But it did not work

And I have one more question, why the related article always said ApplicationDeployment.IsNetworkDeployed But I have to call "System.Deployment.Application.ApplicationDeployment.IsNetworkDeployed"

Did I miss some thing??

TKC
  • 21
  • 1

2 Answers2

0

You can get the version number that is set in the executing AssemblyInfo.cs using this code

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

You can get further information about on the above code from the following link: How to show application version in VS.NET Deployment Project?

Community
  • 1
  • 1
Sormita Chakraborty
  • 1,015
  • 2
  • 19
  • 36
  • When I used "System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.ToString();", I got the "1.0.0.0". – TKC Mar 30 '15 at 08:38
0

Find the file Properties/AssemblyInfo.cs

Manually alter the version

// Version information for an assembly consists of the following four values:
//
//      Major Version
//      Minor Version 
//      Build Number
//      Revision
//
[assembly: AssemblyVersion("1.2.0.0")]
[assembly: AssemblyFileVersion("1.3.0.0")]

It works!!

TKC
  • 21
  • 1