Ensure project paths aren't added to map twice
In MSBuildWorkspaceProjectLoader, there is a map of "discovered" projects that stores the results of any project references. If a project reference can't be loaded (for example, because it is a reference to, say, an F# project), it can end up in the map twice if the project referencing it is multi-targeted. For example, a multi-targeted C# project that references an F# project will fail when loaded because the path to the F# project will get added twice with an empty array of ProjectInfos. The reason for this is that the code assumes that the loaded project will end up in the primary loaded project map, but in this case, the project couldn't be loaded and isn't there. To avoid this situation, we call TryGetValue on the "discovered" projects map and return the results before trying to load the project again.
Showing
想要评论请 注册 或 登录