msbuild: Creating a Microsoft.Build.Evaluation.Project with an SDK fails with an "Internal MSBuild Error"
Microsoft Visual Studio Enterprise 2017 Int Preview Version 15.6.0 Preview 5.0 [27411.0.d15.6]
- Run the following:
var projectRootElement = @"
<Project Sdk=""Microsoft.NET.Sdk"">
</Project>"
var stringReader = new System.IO.StringReader(projectRootElement);
var xmlReader = new XmlTextReader(stringReader);
var root = ProjectRootElement.Create(xmlReader);
var project = new Project(root);
Result StackTrace:
at Microsoft.Build.Shared.ErrorUtilities.ThrowInternalError(String message, Object[] args)
at Microsoft.Build.Shared.ErrorUtilities.VerifyThrow(Boolean condition, String unformattedMessage, Object arg0)
at Microsoft.Build.Shared.AssemblyResources.GetStringFromEngineResources(String name)
at Microsoft.Build.Shared.AssemblyResources.GetString(String name)
at Microsoft.Build.BackEnd.Logging.LoggingService.LogWarningFromText(BuildEventContext buildEventContext, String subcategoryResourceName, String warningCode, String helpKeyword, BuildEventFileInfo file, String message)
at Microsoft.Build.BackEnd.Logging.LoggingService.LogWarning(BuildEventContext buildEventContext, String subcategoryResourceName, BuildEventFileInfo file, String messageResourceName, Object[] messageArgs)
at Microsoft.Build.BackEnd.SdkResolverLoader.LoadResolvers(LoggingContext loggingContext, ElementLocation location)
at Microsoft.Build.BackEnd.SdkResolution.Initialize(LoggingContext loggingContext, ElementLocation location)
at Microsoft.Build.BackEnd.SdkResolution.GetSdkPath(SdkReference sdk, LoggingContext loggingContext, ElementLocation sdkReferenceLocation, String solutionPath, String projectPath)
at Microsoft.Build.Evaluation.Evaluator`4.ExpandAndLoadImportsFromUnescapedImportExpressionConditioned(String directoryOfImportingFile, ProjectImportElement importElement, List`1& projects, Boolean throwOnFileNotExistsError)
at Microsoft.Build.Evaluation.Evaluator`4.ExpandAndLoadImports(String directoryOfImportingFile, ProjectImportElement importElement)
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(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, ProjectInstance projectInstanceIfAnyForDebuggerOnly, SdkResolution sdkResolution)
at Microsoft.Build.Evaluation.Project.Reevaluate(ILoggingService loggingServiceForEvaluation, ProjectLoadSettings loadSettings)
at Microsoft.Build.Evaluation.Project.ReevaluateIfNecessary(ILoggingService loggingServiceForEvaluation, ProjectLoadSettings loadSettings)
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 Microsoft.Build.Evaluation.Project..ctor(ProjectRootElement xml)
at Microsoft.VisualStudio.ProjectSystem.VS.Input.Commands.Ordering.OrderingHelperTests.MoveDownFolder_ContainsNestedFolder_IsSuccessful()
Result Message: Microsoft.Build.Shared.InternalErrorException : MSB0001: Internal MSBuild Error: Missing resource ''
This is failing all our tests that use MSBuild.
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Comments: 15 (10 by maintainers)
Commits related to this issue
- Remove MSBuild Sdk usage from tests Works around https://github.com/Microsoft/msbuild/issues/2997. — committed to davkean/project-system by davkean 6 years ago
- Remove SDK references from tests Works around https://github.com/Microsoft/msbuild/issues/2997. — committed to davkean/project-system by davkean 6 years ago
- Remove SDK references from tests Works around https://github.com/Microsoft/msbuild/issues/2997. — committed to davkean/project-system by davkean 6 years ago
I am using
15.1.548and have started seeing this since updating my VS to 15.6. Not sure if thats a coincidenceOutput:
Result StackTrace: