Blog Home  Home Feed your aggregator (RSS 2.0)  
kevin Mocha - How to get the deployment version?
Bookmarks collected from web.
 
 Thursday, May 22, 2008
        /// <summary>
        /// Information about the currently executing assembly, this is used to determine
        /// our version, etc.
        /// </summary>
        private System.Reflection.Assembly m_assemblyInfo;

        public string version
        {
            get
            {
                string ourVersion = string.Empty;
                //if running the deployed application, you can get the version
                //  from the ApplicationDeployment information. If you try
                //  to access this when you are running in Visual Studio, it will not work.
                if (System.Deployment.Application.ApplicationDeployment.IsNetworkDeployed)
                    ourVersion = ApplicationDeployment.CurrentDeployment.CurrentVersion.ToString();
                else
                    if (m_assemblyInfo != null)
                        ourVersion = m_assemblyInfo.GetName().Version.ToString();
                return ourVersion;
            }
        }

 
Thursday, May 22, 2008 8:14:17 PM UTC  #    Comments [0]    |  Trackback
Name
E-mail
Home page

Comment (HTML not allowed)  

Enter the code shown (prevents robots):

Copyright © 2008 Kevin Mocha. All rights reserved.
DasBlog 'Portal' theme by Johnny Hughes.
Pick a theme: