private static void OnFileChanged(string path) { // The file changed, and needs to be reprocessed s_globalFileCompiled = false; s_buildResult = null; s_globalFileVersion++; }
private void EnsureGlobalFileCompiled() { // This is done only once for all the HttpModule instances every time the file changes Debug.Assert(s_buildResult == null || s_globalFileCompiled); if (s_globalFileCompiled) { return; } lock (typeof(DynamicLanguageHttpModule)) { if (s_globalFileCompiled) { return; } _globalScope = null; s_globalVirtualPath = null; string globalVirtualPath; foreach (string extension in EngineHelper.FileExtensions) { globalVirtualPath = s_globalVirtualPathWithoutExtension + extension; if (HostingEnvironment.VirtualPathProvider.FileExists(globalVirtualPath)) { // Fail if we had already found a global file if (s_globalVirtualPath != null) { throw new Exception(String.Format("A web application can only have one global file. Found both '{0}' and '{1}'", s_globalVirtualPath, globalVirtualPath)); } s_globalVirtualPath = globalVirtualPath; } } // If we found a global file, compile it if (s_globalVirtualPath != null) { s_buildResult = (GlobalAsaxBuildResult)EngineHelper.GetBuildResult(s_globalVirtualPath, this); } // We set this even when there is no file to compile s_globalFileCompiled = true; } }
private void EnsureGlobalFileCompiled() { // This is done only once for all the HttpModule instances every time the file changes Debug.Assert(s_buildResult == null || s_globalFileCompiled); if (s_globalFileCompiled) return; lock (typeof(DynamicLanguageHttpModule)) { if (s_globalFileCompiled) return; _globalScope = null; s_globalVirtualPath = null; string globalVirtualPath; foreach (string extension in EngineHelper.FileExtensions) { globalVirtualPath = s_globalVirtualPathWithoutExtension + extension; if (HostingEnvironment.VirtualPathProvider.FileExists(globalVirtualPath)) { // Fail if we had already found a global file if (s_globalVirtualPath != null) { throw new Exception(String.Format("A web application can only have one global file. Found both '{0}' and '{1}'", s_globalVirtualPath, globalVirtualPath)); } s_globalVirtualPath = globalVirtualPath; } } // If we found a global file, compile it if (s_globalVirtualPath != null) { s_buildResult = (GlobalAsaxBuildResult)EngineHelper.GetBuildResult(s_globalVirtualPath, this); } // We set this even when there is no file to compile s_globalFileCompiled = true; } }
private static void OnFileChanged(string path) { // The file changed, and needs to be reprocessed s_globalFileCompiled = false; s_buildResult = null; s_globalFileVersion++; }