2

アプリケーションのビルドを開始すると、Msbuild が例外をスローします。このエラーについて何か考えがある場合は、お知らせください。

Unhandled Exception: Microsoft.Build.Shared.InternalErrorException: MSB0001: Internal MSBuild Error: The given key was not present in the dictionary.
=============
System.Collections.Generic.KeyNotFoundException: The given key was not present in the dictionary.
at System.Collections.Generic.Dictionary`2.get_Item(TKey key)
at Microsoft.Build.Construction.SolutionProjectGenerator.AddMetaprojectReferenceItems(ProjectInstance traversalProject, ProjectInstance metaprojectInstance, ProjectInSolution project)
at Microsoft.Build.Construction.SolutionProjectGenerator.CreateMetaproject(ProjectInstance traversalProject, ProjectInSolution project, ProjectConfigurationInSolution projectConfiguration)
at Microsoft.Build.Construction.SolutionProjectGenerator.EvaluateAndAddProjects(List`1 projectsInOrder, List`1 projectInstances, ProjectInstance traversalInstance, String selectedSolutionConfiguration)
at Microsoft.Build.Construction.SolutionProjectGenerator.CreateSolutionProject(String wrapperProjectToolsVersion, Boolean explicitToolsVersionSpecified)
at Microsoft.Build.Construction.SolutionProjectGenerator.Generate()
at Microsoft.Build.Execution.ProjectInstance.GenerateSolutionWrapper(String projectFile, IDictionary`2 globalProperties, String toolsVersion, ILoggingService loggingService, BuildEventContext projectBuildEventContext)
at Microsoft.Build.Execution.ProjectInstance.LoadSolutionForBuild(String projectFile, PropertyDictionary`1 globalPropertiesInstances, String toolsVersion, BuildParameters buildParameters, ILoggingService loggingService, BuildEventContext projectBuildEventContext)
at Microsoft.Build.Execution.BuildManager.LoadSolutionIntoConfiguration(BuildRequestConfiguration config, BuildEventContext buildEventContext)
at Microsoft.Build.Execution.BuildManager.HandleNewRequest(Int32 node, BuildRequestBlocker blocker)
at Microsoft.Build.Execution.BuildManager.Microsoft.Build.BackEnd.INodePacketHandler.PacketReceived(Int32 node, INodePacket packet)
at Microsoft.Build.BackEnd.NodeManager.RoutePacket(Int32 nodeId, INodePacket packet)
at Microsoft.Build.BackEnd.NodeProviderInProc.RoutePacket(Int32 nodeId, INodePacket packet)
at Microsoft.Build.BackEnd.NodeEndpointInProc.SendData(INodePacket packet)
at Microsoft.Build.BackEnd.InProcNode.OnNewRequest(BuildRequestBlocker blocker)
at Microsoft.Build.BackEnd.BuildRequestEngine.RaiseRequestBlocked(BuildRequestBlocker blocker)
at Microsoft.Build.BackEnd.BuildRequestEngine.IssueBuildRequest(BuildRequestBlocker blocker)
at Microsoft.Build.BackEnd.BuildRequestEngine.ReportConfigurationResponse(BuildRequestConfigurationResponse response)
at Microsoft.Build.BackEnd.InProcNode.HandlePacket(INodePacket packet)
at Microsoft.Build.BackEnd.InProcNode.Run(Exception& shutdownException)

---> System.Collections.Generic.KeyNotFoundException: The given key was not present in the dictionary.
at System.Collections.Generic.Dictionary`2.get_Item(TKey key)
at Microsoft.Build.Construction.SolutionProjectGenerator.AddMetaprojectReferenceItems(ProjectInstance traversalProject, ProjectInstance metaprojectInstance, ProjectInSolution project)
at Microsoft.Build.Construction.SolutionProjectGenerator.CreateMetaproject(ProjectInstance traversalProject, ProjectInSolution project, ProjectConfigurationInSolution projectConfiguration)
at Microsoft.Build.Construction.SolutionProjectGenerator.EvaluateAndAddProjects(List`1 projectsInOrder, List`1 projectInstances, ProjectInstance traversalInstance, String selectedSolutionConfiguration)
at Microsoft.Build.Construction.SolutionProjectGenerator.CreateSolutionProject(String wrapperProjectToolsVersion, Boolean explicitToolsVersionSpecified)
at Microsoft.Build.Construction.SolutionProjectGenerator.Generate()
at Microsoft.Build.Execution.ProjectInstance.GenerateSolutionWrapper(String projectFile, IDictionary`2 globalProperties, String toolsVersion, ILoggingService loggingService, BuildEventContext projectBuildEventContext)
at Microsoft.Build.Execution.ProjectInstance.LoadSolutionForBuild(String projectFile, PropertyDictionary`1 globalPropertiesInstances, String toolsVersion, BuildParameters buildParameters, ILoggingService loggingService, BuildEventContext projectBuildEventContext)

ありがとうございました。

4

1 に答える 1

0

これは内部エラーです。例外の種類とエラー コード (MSB0001) でわかります。これは、特定の MSBuild バージョンでのみ発生し、おそらく特定のプロジェクト ファイルでのみ発生することを意味します。

同様のエラーが VS2010 で発生し、その後のバージョンで修正されたケースを見てきました。VS2013 では表示されず、VS2015 または VS2017 で導入されたケースを見てきました (すべてのバージョンを確認したわけではありません)。これらのケースはおそらく関連していませんでした。

内部ツールの問題について適切な質問をするには、どのような種類のプロジェクト ファイルの変更 (またはソース ファイルの変更) がこの問題をオンまたはオフにするか、およびどのツール バージョン( s)。

于 2017-09-13T16:42:47.727 に答える