[vs17.14] Fix SdkResult Evalution when ProjectRootElement is null#11636
[vs17.14] Fix SdkResult Evalution when ProjectRootElement is null#11636surayya-MS merged 3 commits intodotnet:vs17.14from
Conversation
|
Is there a workaround to use until this is released as part of the VS (build tools)? |
|
@tsvietOK you could try to copy the old |
Thank you, will try. Do you have any estimates of when this fix will be released? |
This fix will be in Visual Studio 17.14 |
This suggestion helped, thanks! |
Fixes #11550
Context
This is a regression caused by changes in
MSBuildSdkResolverthat were introduced in dotnet/sdk#45364. Specifically by adding 2 new properties.This results in hitting the path that was not hit before - handling properties and items of
SdkResult:msbuild/src/Build/Evaluation/Evaluator.cs
Lines 1867 to 1875 in 6aeb262
When
Projectis created fromXmlReaderand not fromProjectRootElement, it results in nullProjectRootElementduring Evaluation. Which results in internal exception likeInternalErrorException: MSB0001: Internal MSBuild Error: .SdkResolver.1981936763.proj unexpectedly not a rooted pathhere:msbuild/src/Build/Evaluation/Evaluator.cs
Line 1928 in 6aeb262
Above created project path is just
.SdkResolver.1981936763.projwith no directory. Later exception is thrown here because of it:msbuild/src/Build/Evaluation/ProjectRootElementCache.cs
Line 262 in 9e51a07
or here if you use
SimpleProjectRootElementCache:msbuild/src/Build/Evaluation/SimpleProjectRootElementCache.cs
Line 43 in 9e51a07
Changes Made
Changed the projet path that is created for
SdkResultproperties and items - if there is noProjectRootElementthen generate name like{Guid}.SdkResolver.{propertiesAndItemsHash}.projin the current directory.Testing
Added test. Tested manually as well
Notes