diff --git a/src/Main/Base/Project/Src/Project/MSBuildFileProject.cs b/src/Main/Base/Project/Src/Project/MSBuildFileProject.cs index 6106927b22..a357dd47ca 100644 --- a/src/Main/Base/Project/Src/Project/MSBuildFileProject.cs +++ b/src/Main/Base/Project/Src/Project/MSBuildFileProject.cs @@ -2,9 +2,9 @@ // This code is distributed under the GNU LGPL (for details please see \doc\license.txt) using System; +using System.IO; using System.Threading.Tasks; -using ICSharpCode.Core; -using ICSharpCode.SharpDevelop.Gui; +using System.Xml; namespace ICSharpCode.SharpDevelop.Project { @@ -13,8 +13,29 @@ namespace ICSharpCode.SharpDevelop.Project /// public class MSBuildFileProject : AbstractProject { + SolutionFormatVersion minimumSolutionVersion = SolutionFormatVersion.VS2005; + public MSBuildFileProject(ProjectLoadInformation information) : base(information) { + try { + using (XmlReader r = XmlReader.Create(information.FileName, new XmlReaderSettings { IgnoreComments = true, XmlResolver = null })) { + if (r.Read() && r.MoveToContent() == XmlNodeType.Element) { + string toolsVersion = r.GetAttribute("ToolsVersion"); + Version v; + if (Version.TryParse(toolsVersion, out v)) { + if (v >= new Version(4, 0)) { + minimumSolutionVersion = SolutionFormatVersion.VS2010; // use 4.0 Build Worker + } + } + } + } + } catch (XmlException) { + } catch (IOException) { + } + } + + public override SolutionFormatVersion MinimumSolutionVersion { + get { return minimumSolutionVersion; } } public override Task BuildAsync(ProjectBuildOptions options, IBuildFeedbackSink feedbackSink, IProgressMonitor progressMonitor) diff --git a/src/Main/ICSharpCode.SharpDevelop.BuildWorker35/ICSharpCode.SharpDevelop.BuildWorker35.csproj b/src/Main/ICSharpCode.SharpDevelop.BuildWorker35/ICSharpCode.SharpDevelop.BuildWorker35.csproj index 0ff86fbd03..3dcd0e8da6 100644 --- a/src/Main/ICSharpCode.SharpDevelop.BuildWorker35/ICSharpCode.SharpDevelop.BuildWorker35.csproj +++ b/src/Main/ICSharpCode.SharpDevelop.BuildWorker35/ICSharpCode.SharpDevelop.BuildWorker35.csproj @@ -18,12 +18,11 @@ obj\$(Configuration)\ - AnyCPU + x86 False Auto 4194304 4096 - True true diff --git a/src/Tools/Tools.build b/src/Tools/Tools.build index 08d8fa9a47..aa742c378b 100644 --- a/src/Tools/Tools.build +++ b/src/Tools/Tools.build @@ -1,4 +1,4 @@ - + ..\..\data\resources\