Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/monodevelop.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Hutchinson <mhutch@xamarin.com>2014-01-23 07:25:08 +0400
committerMichael Hutchinson <mhutch@xamarin.com>2014-01-23 07:25:08 +0400
commitd85f015843e0b7fe04587b8650d85021354c4e74 (patch)
tree148b80487fd7ff215dfb8df27c44264c0abf4860 /main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Formats.MSBuild/MSBuildProjectHandler.cs
parentda6a2983fd663378821f39d3c35cb2cc44a8873e (diff)
[MSBuild] Improve and test roundtripping of VS-created projects
Diffstat (limited to 'main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Formats.MSBuild/MSBuildProjectHandler.cs')
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Formats.MSBuild/MSBuildProjectHandler.cs13
1 files changed, 9 insertions, 4 deletions
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Formats.MSBuild/MSBuildProjectHandler.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Formats.MSBuild/MSBuildProjectHandler.cs
index e553f5e852..999699ff59 100644
--- a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Formats.MSBuild/MSBuildProjectHandler.cs
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Formats.MSBuild/MSBuildProjectHandler.cs
@@ -70,15 +70,19 @@ namespace MonoDevelop.Projects.Formats.MSBuild
public string ToolsVersion { get; private set; }
string productVersion;
+ string schemaVersion;
public List<string> TargetImports { get; set; }
internal override void SetSolutionFormat (MSBuildFileFormat format, bool converting)
{
- //only touch the ToolsVersion and ProductVersion when converting formats (this happens on creation too)
+ // when converting formats, set ToolsVersion, ProductVersion, SchemaVersion to default values written by VS
+ // this happens on creation too
+ // else we leave them alone and just roundtrip them
if (converting) {
- ToolsVersion = format.ToolsVersion;
- productVersion = format.ProductVersion;
+ ToolsVersion = format.DefaultToolsVersion;
+ productVersion = format.DefaultProductVersion;
+ schemaVersion = format.DefaultSchemaVersion;
}
base.SetSolutionFormat (format, converting);
@@ -316,6 +320,7 @@ namespace MonoDevelop.Projects.Formats.MSBuild
globalGroup = p.AddNewPropertyGroup (false);
productVersion = globalGroup.GetPropertyValue ("ProductVersion");
+ schemaVersion = globalGroup.GetPropertyValue ("SchemaVersion");
string itemGuid = globalGroup.GetPropertyValue ("ProjectGuid");
if (itemGuid == null)
@@ -1096,7 +1101,7 @@ namespace MonoDevelop.Projects.Formats.MSBuild
Item.ExtendedProperties.Remove ("ProjectTypeGuids");
Item.ExtendedProperties ["ProductVersion"] = productVersion;
- Item.ExtendedProperties ["SchemaVersion"] = "2.0";
+ Item.ExtendedProperties ["SchemaVersion"] = schemaVersion;
// having no ToolsVersion is equivalent to 2.0, roundtrip that correctly
if (ToolsVersion != "2.0")