Hello, I'm trying to use SharpDevelop with Xamarin.Forms projects which were created using Visual Studio 2015 community edition. Android projects seem to be working OK so far, and I know I can't build iOS projects because I don't have a Mac, but SharpDevelop seems to be unable to load projects for Windows 10 Universal (.UWP.csproj), Windows 8 Desktop (.Windows.csproj) or Windows 8 Phone (.WinPhone.csproj). Instead, an error is displayed similar to
ICSharpCode.SharpDevelop.Project.ProjectLoadException: A numeric comparison was attempted on "$(TargetPlatformMinVersion)" that evaluates to "10.0.10586.0" instead of a number, in condition "'$(TargetPlatformIdentifier)' == 'UAP' And '$(TargetPlatformMinVersion)' != '' And '$(TargetPlatformMinVersion)' > '10.0.10587.0'". C:\Program Files (x86)\MSBuild\Microsoft\WindowsXaml\v14.0\Microsoft.Windows.UI.Xaml.Common.targets ---> Microsoft.Build.Exceptions.InvalidProjectFileException: A numeric comparison was attempted on "$(TargetPlatformMinVersion)" that evaluates to "10.0.10586.0" instead of a number, in condition "'$(TargetPlatformIdentifier)' == 'UAP' And '$(TargetPlatformMinVersion)' != '' And '$(TargetPlatformMinVersion)' > '10.0.10587.0'". C:\Program Files (x86)\MSBuild\Microsoft\WindowsXaml\v14.0\Microsoft.Windows.UI.Xaml.Common.targets
at Microsoft.Build.Shared.ProjectErrorUtilities.ThrowInvalidProject(String errorSubCategoryResourceName, IElementLocation elementLocation, String resourceName, Object[ args)
at Microsoft.Build.Evaluation.NumericComparisonExpressionNode.BoolEvaluate(IConditionEvaluationState state)
at Microsoft.Build.Evaluation.AndExpressionNode.BoolEvaluate(IConditionEvaluationState state)
at Microsoft.Build.Evaluation.GenericExpressionNode.Evaluate(IConditionEvaluationState state)
at Microsoft.Build.Evaluation.ConditionEvaluator.EvaluateConditionCollectingConditionedProperties[P,I](String condition, ParserOptions options, Expander`2 expander, ExpanderOptions expanderOptions, Dictionary`2 conditionedPropertiesTable, String evaluationDirectory, ElementLocation elementLocation, ILoggingService loggingServices, BuildEventContext buildEventContext)
at Microsoft.Build.Evaluation.Evaluator`4.EvaluateConditionCollectingConditionedProperties(ProjectElement element, ExpanderOptions expanderOptions, ParserOptions parserOptions)
at Microsoft.Build.Evaluation.Evaluator`4.EvaluatePropertyGroupElement(ProjectPropertyGroupElement propertyGroupElement)
at Microsoft.Build.Evaluation.Evaluator`4.PerformDepthFirstPass(ProjectRootElement currentProjectOrImport)
at Microsoft.Build.Evaluation.Evaluator`4.EvaluateImportElement(String directoryOfImportingFile, ProjectImportElement importElement)
at Microsoft.Build.Evaluation.Evaluator`4.PerformDepthFirstPass(ProjectRootElement currentProjectOrImport)
at Microsoft.Build.Evaluation.Evaluator`4.EvaluateImportElement(String directoryOfImportingFile, ProjectImportElement importElement)
at Microsoft.Build.Evaluation.Evaluator`4.PerformDepthFirstPass(ProjectRootElement currentProjectOrImport)
at Microsoft.Build.Evaluation.Evaluator`4.Evaluate()
at Microsoft.Build.Evaluation.Evaluator`4.Evaluate(IEvaluatorData`4 data, ProjectRootElement root, ProjectLoadSettings loadSettings, Int32 maxNodeCount, PropertyDictionary`1 environmentProperties, ILoggingService loggingService, IItemFactory`2 itemFactory, IToolsetProvider toolsetProvider, ProjectRootElementCache projectRootElementCache, BuildEventContext buildEventContext, ProjectInstance projectInstanceIfAnyForDebuggerOnly)
at Microsoft.Build.Evaluation.Project.ReevaluateIfNecessary(ILoggingService loggingServiceForEvaluation)
at Microsoft.Build.Evaluation.Project.Initialize(IDictionary`2 globalProperties, String toolsVersion, String subToolsetVersion, ProjectLoadSettings loadSettings)
at Microsoft.Build.Evaluation.Project..ctor(ProjectRootElement xml, IDictionary`2 globalProperties, String toolsVersion, String subToolsetVersion, ProjectCollection projectCollection, ProjectLoadSettings loadSettings)
at ICSharpCode.SharpDevelop.Project.MSBuildInternals.LoadProject(ProjectCollection projectCollection, ProjectRootElement rootElement, IDictionary`2 globalProps)
at ICSharpCode.SharpDevelop.Project.MSBuildBasedProject.OpenConfiguration(String configuration, String platform)
at ICSharpCode.SharpDevelop.Project.MSBuildBasedProject.GetEvaluatedProperty(String propertyName)
at ICSharpCode.SharpDevelop.Project.MSBuildBasedProject.LoadProjectInternal(ProjectLoadInformation loadInformation)
at ICSharpCode.SharpDevelop.Project.MSBuildBasedProject..ctor(ProjectLoadInformation loadInformation)
--- End of inner exception stack trace ---
at ICSharpCode.SharpDevelop.Project.MSBuildBasedProject..ctor(ProjectLoadInformation loadInformation)
at ICSharpCode.SharpDevelop.Project.CompilableProject..ctor(ProjectLoadInformation information)
at CSharpBinding.CSharpProject..ctor(ProjectLoadInformation loadInformation)
at CSharpBinding.CSharpProjectBinding.LoadProject(ProjectLoadInformation loadInformation)
at ICSharpCode.SharpDevelop.Project.SDProjectService.LoadProject(ProjectLoadInformation info)
at ICSharpCode.SharpDevelop.Project.SolutionLoader.LoadProjectWithErrorHandling(ProjectLoadInformation projectInfo)
The problem appears to be that MSBuild is trying to compare a 4-part version number with a property which MSBuild is expecting to be numeric, and that MSBuild 14.0 allows this but MSBuild 12.0 doesn't. I've tried resolving this by changing any references to VisualStudioVersion or ToolsVersion in the project files from 12 or 12.0 to 14 or 14.0, but it just seems to move the problem to a similar error another condition somewhere else in the MSBuild target files, each time saying a numeric comparison was attempted with a 4-part version number, and it seems that for some reason it's MSBuild 12.0 attempting the comparison, even though I'm trying to use MSBuild 14.0.
If I use MSBuild Explorer to build the project, this particular problem seems to go away if I add the line
call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat"
to the pre-build commands, seemingly enforcing the use of MSBuild 14.0 at all stages. Can I do something similar within SharpDevelop to tell it to use MSBuild 14.0 to load these projects?
Thanks
Simon
My SharpDevelop info:
SharpDevelop Version : 5.1.0.5134-RC-d5052dc5
.NET Version : 4.6.01586
OS Version : Microsoft Windows NT 6.3.9600.0
Current culture : English (United Kingdom) (en-GB)
Running under WOW6432, processor architecture: x86-64
Working Set Memory : 410216kb
GC Heap Memory : 231786kb