novotnyllc / MSBuildSdkExtras

Extra properties for MSBuild SDK projects
MIT License
347 stars 42 forks source link

UAP targets no longer available during the build #180

Closed GeertvanHorrik closed 5 years ago

GeertvanHorrik commented 5 years ago

Yesterday I updated VS 2019 preview (16.3 preview 2) and installed some components. Suddenly the builds with UAP stopped working:

The specified language targets for uap10.0.16299 is missing. Ensure correct tooling is installed for 'uap'. Missing: 'C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\MSBuild\Microsoft\WindowsXaml\v16.0\Microsoft.Windows.UI.Xaml.CSharp.targets' Catel.Core  C:\Users\geert\.nuget\packages\msbuild.sdk.extras\2.0.31\Build\LanguageTargets\CheckMissing.targets 36  

and

The specified language targets for uap10.0 is missing. Ensure correct tooling is installed for 'uap'. Missing: 'C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\MSBuild\Microsoft\WindowsXaml\v16.0\Microsoft.Windows.UI.Xaml.CSharp.targets'   Catel.Core  C:\Users\geert\.nuget\packages\msbuild.sdk.extras\2.0.31\Build\LanguageTargets\CheckMissing.targets 36  

Will try to figure out why this happens.

GeertvanHorrik commented 5 years ago

Doing a full VS install repair to see if that fixes things.

GeertvanHorrik commented 5 years ago

Nope, full repair didn't fix it. Weird thing is the build agents are fine. Still investigating.

GeertvanHorrik commented 5 years ago

Trying to use MsBuildTasksExplorer to investigate, but it throws errors:

The project "C:\Source\Catel\src\Catel.Core\Catel.Core.csproj" was not loaded.
A numeric comparison was attempted on "$(_TargetFrameworkVersionWithoutV)" that evaluates to "" instead of a number, in condition "'$(_TargetFrameworkVersionWithoutV)' >= '4.0'".  C:\Program Files\dotnet\sdk\3.0.100-preview8-013656\Sdks\Microsoft.NET.Sdk.WindowsDesktop\targets\Microsoft.NET.Sdk.WindowsDesktop.props
Stack trace:
   at Microsoft.Build.Shared.ProjectErrorUtilities.ThrowInvalidProject(String errorSubCategoryResourceName, IElementLocation elementLocation, String resourceName, Object[] args)
   at Microsoft.Build.Shared.ProjectErrorUtilities.VerifyThrowInvalidProject[T1,T2,T3](Boolean condition, String errorSubCategoryResourceName, IElementLocation elementLocation, String resourceName, T1 arg0, T2 arg1, T3 arg2)
   at Microsoft.Build.Evaluation.NumericComparisonExpressionNode.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, IFileSystem fileSystem, ProjectRootElementCache projectRootElementCache)
   at Microsoft.Build.Evaluation.ConditionEvaluator.EvaluateCondition[P,I](String condition, ParserOptions options, Expander`2 expander, ExpanderOptions expanderOptions, String evaluationDirectory, ElementLocation elementLocation, ILoggingService loggingServices, BuildEventContext buildEventContext, IFileSystem fileSystem, ProjectRootElementCache projectRootElementCache)
   at Microsoft.Build.Evaluation.LazyItemEvaluator`4.EvaluateCondition(String condition, ProjectElement element, ExpanderOptions expanderOptions, ParserOptions parserOptions, Expander`2 expander, LazyItemEvaluator`4 lazyEvaluator)
   at Microsoft.Build.Evaluation.LazyItemEvaluator`4.EvaluateCondition(ProjectElement element, ExpanderOptions expanderOptions, ParserOptions parserOptions, Expander`2 expander, LazyItemEvaluator`4 lazyEvaluator)
   at Microsoft.Build.Evaluation.LazyItemEvaluator`4.EvaluateConditionWithCurrentState(ProjectElement element, ExpanderOptions expanderOptions, ParserOptions parserOptions)
   at Microsoft.Build.Evaluation.Evaluator`4.EvaluateItemElement(Boolean itemGroupConditionResult, ProjectItemElement itemElement, LazyItemEvaluator`4 lazyEvaluator)
   at Microsoft.Build.Evaluation.Evaluator`4.EvaluateItemGroupElement(ProjectItemGroupElement itemGroupElement, LazyItemEvaluator`4 lazyEvaluator)
   at Microsoft.Build.Evaluation.Evaluator`4.Evaluate(ILoggingService loggingService, BuildEventContext buildEventContext)
   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, ISdkResolverService sdkResolverService, Int32 submissionId, EvaluationContext evaluationContext, Boolean interactive)
   at Microsoft.Build.Evaluation.Project.Reevaluate(ILoggingService loggingServiceForEvaluation, ProjectLoadSettings loadSettings, EvaluationContext evaluationContext)
   at Microsoft.Build.Evaluation.Project.ReevaluateIfNecessary(ILoggingService loggingServiceForEvaluation, ProjectLoadSettings loadSettings, EvaluationContext evaluationContext)
   at Microsoft.Build.Evaluation.Project.Initialize(IDictionary`2 globalProperties, String toolsVersion, String subToolsetVersion, ProjectLoadSettings loadSettings, EvaluationContext evaluationContext)
   at Microsoft.Build.Evaluation.Project..ctor(String projectFile, IDictionary`2 globalProperties, String toolsVersion, String subToolsetVersion, ProjectCollection projectCollection, ProjectLoadSettings loadSettings, EvaluationContext evaluationContext)
   at Microsoft.Build.Evaluation.ProjectCollection.LoadProject(String fileName, IDictionary`2 globalProperties, String toolsVersion)
   at MsBuildTaskExplorer.SolutionInfo.BuildMsBuildTask(String fullPath) in E:\Projects\00\MsBuildTaskExplorer\MsBuildTaskExplorer\SolutionInfo.cs:line 125
   at MsBuildTaskExplorer.SolutionInfo.GetMsBuildTasks(DirectoryInfo directory) in E:\Projects\00\MsBuildTaskExplorer\MsBuildTaskExplorer\SolutionInfo.cs:line 104
Exception: Microsoft.Build.Exceptions.InvalidProjectFileException
GeertvanHorrik commented 5 years ago

image

maxkatz6 commented 5 years ago

I have same problem with latest VS Preview. It was fixed by https://github.com/onovotny/MSBuildSdkExtras/issues/178 Just update to MSBuildSdkExtras 2.0.41

GeertvanHorrik commented 5 years ago

The first thing I did yesterday was updating to the latest version, but then it was "just" 2.0.31. I really appreciate you taking the time to respond to this ticket @Tirraon ! And thanks for @onovotny for fixing it, much appreciated!