You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Probably not specific to this test, but rather a race condition with the [UseExportProvider] attribute and ExportProviderCache bits, and we've just hit some threshold of tests that make it more probable to hit.
I seem to remember the WebTools code hitting this in years past, and the exception is coming from those bits.
System.InvalidOperationException : ExportProviderCache may only be used from tests marked with UseExportProviderAttribute
at Microsoft.AspNetCore.Razor.Test.Common.Mef.ExportProviderCache.SingleExportProviderFactory.GetOrCreateExportProvider() in /_/src/Razor/test/Microsoft.AspNetCore.Razor.Test.Common.Tooling/Mef/ExportProviderCache.cs:line 159
at Microsoft.AspNetCore.Razor.Test.Common.Mef.ExportProviderCache.SingleExportProviderFactory.Microsoft.VisualStudio.Composition.IExportProviderFactory.CreateExportProvider() in /_/src/Razor/test/Microsoft.AspNetCore.Razor.Test.Common.Tooling/Mef/ExportProviderCache.cs:line 219
at Microsoft.CodeAnalysis.Razor.Formatting.HtmlFormatting.<CallWebToolsApplyFormattedEditsHandlerAsync>d__2.MoveNext() in /_/src/Razor/test/Microsoft.AspNetCore.Razor.Test.Common.Tooling/Formatting_NetFx/HtmlFormatting.cs:line 69
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.VisualStudio.Razor.LanguageClient.Cohost.CohostOnTypeFormattingEndpointTest.<VerifyOnTypeFormattingAsync>d__5.MoveNext() in /_/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostOnTypeFormattingEndpointTest.cs:line 118
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.VisualStudio.Razor.LanguageClient.Cohost.CohostOnTypeFormattingEndpointTest.<FormatsSimpleHtmlTag_OnType>d__4.MoveNext() in /_/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostOnTypeFormattingEndpointTest.cs:line 79
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
The text was updated successfully, but these errors were encountered:
Fixes#10696Fixes#10769Fixes#10874
Needs Roslyn change: dotnet/roslyn#75102
The actual code change was quite straight foward. The test code was a
bigger pain. Previously in cohosting tests we had two MEF composition,
one for Razor and one for Roslyn. Since Roslyn diagnostics can only run,
or at least start, in devenv, we now need three MEF compositions -
Roslyn devenv, Roslyn OOP and razor OOP - and two workspaces - Roslyn
devenv and Roslyn OOP - and our previous MEF infrastructure really
didn't handle this well, as evidenced by the fact that this PR also
fixes#10874
Now our MEF infra is simpler: We still cache catalogs etc. statically
the save time, but we create an `ExportProvider` as needed and expect
consumers to dispose of it like any other `IDisposable`, though there is
also here a test fixture to share the editor composition in the
formatting tests so we don't pay a huge penalty in terms of test run
time.
Commit-at-a-time if you want to read the story from beginning to end,
but it should be reasonably okay to just review as a whole too.
Probably not specific to this test, but rather a race condition with the
[UseExportProvider]
attribute andExportProviderCache
bits, and we've just hit some threshold of tests that make it more probable to hit.I seem to remember the WebTools code hitting this in years past, and the exception is coming from those bits.
The text was updated successfully, but these errors were encountered: