GetVersion() private method

private GetVersion ( string path ) : Version
path string
return Version
Exemplo n.º 1
0
        // Adds Parameter for unit tests
        internal static bool StartCore(Version testVersion = null)
        {
            var version = testVersion ?? WebPagesDeployment.GetVersion(HttpRuntime.AppDomainAppPath, WebConfigurationManager.AppSettings);

            bool loaded = false;

            if (version == AssemblyUtils.ThisAssemblyName.Version)
            {
                Debug.WriteLine("WebPages Bootstrapper v{0}: loading WebPages", AssemblyUtils.ThisAssemblyName.Version);

                loaded = true;
                if (testVersion == null)
                {
                    LoadWebPages();
                }
            }
            else if (version == null)
            {
                Debug.WriteLine("WebPages Bootstrapper v{0}: WebPages not enabled, registering for change notifications", AssemblyUtils.ThisAssemblyName.Version);

                // Register for change notifications under the application root
                // but do not register if webPages:Enabled has been explicitly set to false (Dev10 bug 913600)
                if (testVersion == null && !WebPagesDeployment.IsExplicitlyDisabled(WebConfigurationManager.AppSettings))
                {
                    RegisterForChangeNotifications();
                }
            }
            else
            {
                Debug.WriteLine("WebPages Bootstrapper v{0}: site version is {1}, not loading WebPages", AssemblyUtils.ThisAssemblyName.Version, version);
            }
            return(loaded);
        }