Fix failure to initialize RemoteWorkspace in the out-of-process host#25691
Fix failure to initialize RemoteWorkspace in the out-of-process host#25691sharwell merged 1 commit intodotnet:dev15.7.xfrom
Conversation
|
@dotnet-bot retest windows_debug_vs-integration_prtest please. |
| get | ||
| { | ||
| var exportProvider = (IMefHostExportProvider)RoslynServices.HostServices; | ||
| var primaryWorkspace = exportProvider.GetExports<PrimaryWorkspace>().Single().Value; |
There was a problem hiding this comment.
this and code in RoslynServices are dup except HostServices. it would be less confusing who sets PrimaryWorkspace if it is extracted out to like "RemoteWorkspace.GetOrCreate(HostServices)" and reused in both places.
and explain that any one who calls this method first will set PrimaryWorkspace for the HostServices.
There was a problem hiding this comment.
The caller should not be attempting to use the workspace prior to an explicit initialization sequence somewhere. This PR is just a workaround until the underlying design flaw can be fixed.
There was a problem hiding this comment.
there is no elsewhere in service hub host.
|
@jinujoseph @sharwell Can we take this now and then do a cherry-pick into the Preview 3 branch? I understand we want to take this through escrow but since it's also blocking integration tests I'd like to clear that too. |
|
if It is blocking some code flow, de-duping the code is not important enough to block code flow. |
|
@jinujoseph This is only needed for Preview 3 if #25469 is approved for Preview 3. We should get a decision on that before merging this. |
Customer scenario
Visual Studio crashes as soon as a project is opened.
Bugs this fixes
https://devdiv.visualstudio.com/DevDiv/NET%20Developer%20Experience%20Productivity/_workitems/edit/590114
Workarounds, if any
None.
Risk
Relatively low.
Performance impact
N/A
Is this a regression from a previous update?
Yes, caused by f12bda8
Root cause analysis
There were two contributing factors to this:
How was the bug found?
We turned integration tests back on.
Test documentation updated?
N/A