Skip to content

Creating a Microsoft.Build.Evaluation.Project with an SDK fails with an "Internal MSBuild Error" #2997

@davkean

Description

@davkean

Microsoft Visual Studio Enterprise 2017 Int Preview
Version 15.6.0 Preview 5.0 [27411.0.d15.6]

  1. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions