private static void RewriteWebConfig(AutoRemovableDirectory tempFiles, ConfigReplacements replacements) { var webConfig = tempFiles.ReadFile("Web.config"); var configRewriter = new ConfigRewriter(new ConfigSources(new Dictionary <string, string>())); var rewrittenWebConfig = configRewriter.Rewrite(webConfig, replacements); tempFiles.WriteFile("Web.config", rewrittenWebConfig); }
private string WithRewrittenWebConfig(string projectPath, ConfigReplacements replacements) { var tempFiles = new AutoRemovableDirectory(); var root = new DirectoryInfo(projectPath); var rootUri = new Uri(Commons.EnsureTrailingSlash(projectPath)); CopyFilesFromDir(tempFiles, rootUri, root); foreach (var dir in root.GetDirectories("*.*", System.IO.SearchOption.AllDirectories)) { CopyFilesFromDir(tempFiles, rootUri, dir); } RewriteWebConfig(tempFiles, replacements); return(tempFiles.BasePath); }
public DeployedApp(string sourcePath, ConfigReplacements replacements) { this.sourcePath = sourcePath; this.replacements = replacements; }