diff options
author | Lluis Sanchez Gual <lluis@xamarin.com> | 2015-04-20 19:07:51 +0300 |
---|---|---|
committer | Lluis Sanchez Gual <lluis@xamarin.com> | 2015-04-20 19:07:51 +0300 |
commit | 95408b1a41b31b645f3a8c3323ab7d3ca4bff26b (patch) | |
tree | f8f137cddcb9a40499d303be95722fd2c6081bce /main/src/addins/AspNet/Projects/AspNetAppProjectFlavor.cs | |
parent | b70e4e04b4e41b8ec28d7e4b220b401ecf467e7a (diff) | |
parent | de043d330a8bf5855d4d983c804cd36727cb2406 (diff) |
Merge remote-tracking branch 'origin/roslyn' into new-project-model
Diffstat (limited to 'main/src/addins/AspNet/Projects/AspNetAppProjectFlavor.cs')
-rw-r--r-- | main/src/addins/AspNet/Projects/AspNetAppProjectFlavor.cs | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/main/src/addins/AspNet/Projects/AspNetAppProjectFlavor.cs b/main/src/addins/AspNet/Projects/AspNetAppProjectFlavor.cs index bc33cb1320..75a7277a95 100644 --- a/main/src/addins/AspNet/Projects/AspNetAppProjectFlavor.cs +++ b/main/src/addins/AspNet/Projects/AspNetAppProjectFlavor.cs @@ -36,9 +36,8 @@ using System.Linq; using System.Reflection; using System.Xml; -using ICSharpCode.NRefactory.TypeSystem; - using MonoDevelop.Core; +using MonoDevelop.Core.Text; using MonoDevelop.Core.Assemblies; using MonoDevelop.Core.Execution; using MonoDevelop.Core.ProgressMonitoring; @@ -400,12 +399,10 @@ namespace MonoDevelop.AspNet.Projects var webConfig = GetWebConfig (); if (webConfig == null || !File.Exists (webConfig.FilePath)) return; - - var textFile = TextFileProvider.Instance.GetEditableTextFile (webConfig.FilePath); + //use textfile API because it's write safe (writes out to another file then moves) - if (textFile == null) - textFile = MonoDevelop.Projects.Text.TextFile.ReadFile (webConfig.FilePath); - + var textFile = MonoDevelop.Ide.TextFileProvider.Instance.GetEditableTextFile (webConfig.FilePath); + //can't use System.Web.Configuration.WebConfigurationManager, as it can only access virtual paths within an app //so need full manual handling try { @@ -465,10 +462,7 @@ namespace MonoDevelop.AspNet.Projects doc.WriteTo (tw); tw.Flush (); textFile.Text = sw.ToString (); - - MonoDevelop.Projects.Text.TextFile tf = textFile as MonoDevelop.Projects.Text.TextFile; - if (tf != null) - tf.Save (); + textFile.WriteTextTo (textFile.FileName); } catch (Exception e) { LoggingService.LogWarning ("Could not modify application web.config in project " + Project.Name, e); } |