Skip to content

Commit

Permalink
Merge pull request #60366 from JoeRobich/main-thread
Browse files Browse the repository at this point in the history
Create solution on the main thread in integration tests
  • Loading branch information
JoeRobich authored Mar 24, 2022
2 parents 50e6dae + 75d0890 commit 373411a
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public CSharpCodeDefinitionWindow(VisualStudioInstanceFactory instanceFactory)
{
}

[WpfTheory]
[WpfTheory(Skip = "https://github.com/dotnet/roslyn/issues/60364")]
[CombinatorialData]
public void CodeDefinitionWindowOpensMetadataAsSource(bool enableDecompilation)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public BasicCodeDefinitionWindow(VisualStudioInstanceFactory instanceFactory)
{
}

[WpfTheory]
[WpfTheory(Skip = "https://github.com/dotnet/roslyn/issues/60364")]
[CombinatorialData]
public void CodeDefinitionWindowOpensMetadataAsSource(bool enableDecompilation)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,11 @@ public void CreateSolution(string solutionName, bool saveExistingSolutionIfExist
Directory.CreateDirectory(solutionPath);

var solution = GetGlobalService<SVsSolution, IVsSolution>();
ErrorHandler.ThrowOnFailure(solution.CreateSolution(solutionPath, solutionFileName, (uint)__VSCREATESOLUTIONFLAGS.CSF_SILENT));
ErrorHandler.ThrowOnFailure(solution.SaveSolutionElement((uint)__VSSLNSAVEOPTIONS.SLNSAVEOPT_ForceSave, null, 0));
InvokeOnUIThread(cancellationToken =>
{
ErrorHandler.ThrowOnFailure(solution.CreateSolution(solutionPath, solutionFileName, (uint)__VSCREATESOLUTIONFLAGS.CSF_SILENT));
ErrorHandler.ThrowOnFailure(solution.SaveSolutionElement((uint)__VSSLNSAVEOPTIONS.SLNSAVEOPT_ForceSave, null, 0));
});

_solution = (Solution2)dte.Solution;
_fileName = Path.Combine(solutionPath, solutionFileName);
Expand Down Expand Up @@ -441,7 +444,11 @@ private void CloseSolution()
solutionEvents.AfterCloseSolution += HandleAfterCloseSolution;
try
{
ErrorHandler.ThrowOnFailure(solution.CloseSolutionElement((uint)__VSSLNCLOSEOPTIONS.SLNCLOSEOPT_DeleteProject | (uint)__VSSLNSAVEOPTIONS.SLNSAVEOPT_NoSave, null, 0));
InvokeOnUIThread(cancellationToken =>
{
ErrorHandler.ThrowOnFailure(solution.CloseSolutionElement((uint)__VSSLNCLOSEOPTIONS.SLNCLOSEOPT_DeleteProject | (uint)__VSSLNSAVEOPTIONS.SLNSAVEOPT_NoSave, null, 0));
});

semaphore.Wait();
}
finally
Expand Down

0 comments on commit 373411a

Please sign in to comment.