/// <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; }
public static void Transform(this IEnumerable<WebConfigTransformer> transformers, WebConfigHelper webConfig) { foreach (var transformer in transformers) { transformer.Transform(webConfig); } }
private static WebConfigHelper CreateDefaultWebConfig() { return(WebConfigHelper.New() .AddTargetFramework("4.5") .AddExtensionlessUrlHandlers() .ConfigureAllowDoubleEscaping()); }
/// <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; }
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); }
/// <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(); }
/// <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(); }
public void Transform(WebConfigHelper config) { _transform(config); }
/// <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 webConfig) { webConfig.AddAppSection("aspnet:UseTaskFriendlySynchronizationContext", "true"); }
public static void Transform(this IEnumerable <WebConfigTransformer> transformers, WebConfigHelper webConfig) { foreach (var transformer in transformers) { transformer.Transform(webConfig); } }
private static WebConfigHelper CreateDefaultWebConfig() { return(WebConfigHelper.New().AddTargetFramework("4.0").AddExtensionlessUrlHandlers()); }
public static void UpdateWebConfig(WebConfigHelper webConfig) { webConfig.AddRAMFAR(true); }