Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions src/VisualStudio/ProjectPackage/NodesSDK/SdkProjectNode.cs
Original file line number Diff line number Diff line change
Expand Up @@ -743,6 +743,19 @@ public override void BeforeSave()
}

private void AddPendingReferences(List<string> newReferences, SdkSubProjectInfo active)
{
// Callers include XSharpIDEBuildLogger.ProjectFinishedHandler, which runs on
// an MSBuild logger (background) thread, but this method disposes
// XSharpDependencyNode (an AssemblyReferenceNode), whose Dispose() requires
// the UI thread. Marshal onto the UI thread before touching any hierarchy node.
ThreadHelper.JoinableTaskFactory.Run(async delegate
{
await ThreadHelper.JoinableTaskFactory.SwitchToMainThreadAsync();
AddPendingReferencesOnUIThread(newReferences, active);
});
}

private void AddPendingReferencesOnUIThread(List<string> newReferences, SdkSubProjectInfo active)
{
HierarchyNode frameworkNode = null;
if (SubProjects.Count > 1)
Expand Down