private ForceRecompile ( IFileSystem fileSystem, string binDirectory ) : void | ||
fileSystem | IFileSystem | |
binDirectory | string | |
return | void |
/// <summary> /// WebPages stores the version to be compiled against in AppSettings as >add key="webpages:version" value="1.0" /<. /// Changing values AppSettings does not cause recompilation therefore we could run into a state where we have files compiled against v1 but the application is /// currently v2. /// </summary> private static void InvalidateCompilationResultsIfVersionChanged( IBuildManager buildManager, IFileSystem fileSystem, string binDirectory, Version currentVersion ) { Version previousVersion = WebPagesDeployment.GetPreviousRuntimeVersion(buildManager); // Persist the current version number in BuildManager's cached file WebPagesDeployment.PersistRuntimeVersion(buildManager, currentVersion); if (previousVersion == null) { // Do nothing. } else if (previousVersion != currentVersion) { // If the previous runtime version is different, perturb the bin directory so that it forces recompilation. WebPagesDeployment.ForceRecompile(fileSystem, binDirectory); var httpCompileException = new HttpCompileException( ConfigurationResources.WebPagesVersionChanges ); // Indicator for tooling httpCompileException.Data[ToolingIndicatorKey] = true; throw httpCompileException; } }