예제 #1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="WebAppSetupOptions"/> class.
 /// </summary>
 public WebAppSetupOptions()
 {
     this.TextFiles   = new Dictionary <string, string>();
     this.BinaryFiles = new List <string>();
     this._routesOpts = new List <AbstactRouteSetup>();
     this._webConfig  = null;
 }
예제 #2
0
 public static void Transform(this IEnumerable<WebConfigTransformer> transformers, WebConfigHelper webConfig)
 {
     foreach (var transformer in transformers)
     {
         transformer.Transform(webConfig);
     }
 }
예제 #3
0
 private static WebConfigHelper CreateDefaultWebConfig()
 {
     return(WebConfigHelper.New()
            .AddTargetFramework("4.5")
            .AddExtensionlessUrlHandlers()
            .ConfigureAllowDoubleEscaping());
 }
예제 #4
0
 /// <summary>
 /// Initializes a new instance of the <see cref="WebAppSetupOptions"/> class. 
 /// </summary>
 public WebAppSetupOptions()
 {
     this.TextFiles = new Dictionary<string, string>();
     this.BinaryFiles = new List<string>();
     this._routesOpts = new List<AbstactRouteSetup>();
     this._webConfig = null;
 }
예제 #5
0
        public virtual void Deploy(IDirectory source)
        {
            if (source == null)
            {
                throw new ArgumentNullException("source");
            }

            if (RemoveEmptyDirectory)
            {
                source.RemoveEmptyDirectories();
            }

            if (WebConfigTransformers.Count > 0)
            {
                WebConfigHelper config;
                var             file = source.FindFile(WebConfigFileName);
                if (file == null)
                {
                    file   = source.CreateFile(WebConfigFileName);
                    config = WebConfigHelper.New();
                }
                else
                {
                    config = WebConfigHelper.Load(file.ReadAsString());
                }

                WebConfigTransformers.Transform(config);

                file.WriteString(config.ToString());
            }

            DeployCore(source);
        }
예제 #6
0
        /// <summary>
        /// Update the WebConfig file
        ///
        /// Accecpt a WebConfigHelper instance to replace the exist one. TextFiles
        /// dictionary will be updated accordingly.
        /// </summary>
        public void UpdateWebConfig(WebConfigHelper webConfig)
        {
            if (webConfig == null)
            {
                throw new ArgumentNullException("webConfig");
            }

            this._webConfig = webConfig;
            this.TextFiles["web.config"] = _webConfig.ToString();
        }
예제 #7
0
        /// <summary>
        /// Update the WebConfig file.
        ///
        /// Accept a action of update XElement representing the WebConfig. If there is no
        /// web.config exists by the time this method is called, a default web.config xml dom
        /// will be created. After update action is excuted the web.config represent in
        /// TextFiles will be updated.
        ///
        /// If the action is null, no exception will be thrown but the web.config will be
        /// always updated.
        /// </summary>
        public void UpdateWebConfig(Action <WebConfigHelper> action)
        {
            if (action == null)
            {
                throw new ArgumentNullException("action");
            }

            if (_webConfig == null)
            {
                _webConfig = CreateDefaultWebConfig();
            }

            action(this._webConfig);
            this.TextFiles["web.config"] = _webConfig.ToString();
        }
 public static void UpdateWebConfig(WebConfigHelper config)
 {
     config.AddODataLibAssemblyRedirection();
 }
예제 #9
0
 public void Transform(WebConfigHelper config)
 {
     _transform(config);
 }
예제 #10
0
        /// <summary>
        /// Update the WebConfig file
        /// 
        /// Accecpt a WebConfigHelper instance to replace the exist one. TextFiles 
        /// dictionary will be updated accordingly.
        /// </summary>
        public void UpdateWebConfig(WebConfigHelper webConfig)
        {
            if (webConfig == null)
            {
                throw new ArgumentNullException("webConfig");
            }

            this._webConfig = webConfig;
            this.TextFiles["web.config"] = _webConfig.ToString();
        }
예제 #11
0
        /// <summary>
        /// Update the WebConfig file.
        /// 
        /// Accept a action of update XElement representing the WebConfig. If there is no 
        /// web.config exists by the time this method is called, a default web.config xml dom 
        /// will be created. After update action is excuted the web.config represent in
        /// TextFiles will be updated.
        /// 
        /// If the action is null, no exception will be thrown but the web.config will be 
        /// always updated.
        /// </summary>
        public void UpdateWebConfig(Action<WebConfigHelper> action)
        {
            if (action == null)
            {
                throw new ArgumentNullException("action");
            }

            if (_webConfig == null)
            {
                _webConfig = CreateDefaultWebConfig();
            }

            action(this._webConfig);
            this.TextFiles["web.config"] = _webConfig.ToString();
        }
예제 #12
0
 public static void UpdateWebConfig(WebConfigHelper webConfig)
 {
     webConfig.AddAppSection("aspnet:UseTaskFriendlySynchronizationContext", "true");
 }
예제 #13
0
 public static void Transform(this IEnumerable <WebConfigTransformer> transformers, WebConfigHelper webConfig)
 {
     foreach (var transformer in transformers)
     {
         transformer.Transform(webConfig);
     }
 }
예제 #14
0
 public void Transform(WebConfigHelper config)
 {
     _transform(config);
 }
예제 #15
0
 private static WebConfigHelper CreateDefaultWebConfig()
 {
     return(WebConfigHelper.New().AddTargetFramework("4.0").AddExtensionlessUrlHandlers());
 }
 public static void UpdateWebConfig(WebConfigHelper webConfig)
 {
     webConfig.AddRAMFAR(true);
 }