コード例 #1
0
        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);
        }
コード例 #2
0
        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);
        }
コード例 #3
0
 public DeployedApp(string sourcePath, ConfigReplacements replacements)
 {
     this.sourcePath   = sourcePath;
     this.replacements = replacements;
 }