Skip to content

Commit 121ba61

Browse files
authored
Fix reflection use in integration tests (#77669)
In https://devdiv.visualstudio.com/DevDiv/_git/VSEditor/pullrequest/618447 the field name was changed, so tests will break in future. We just got broken by this in Razor because we test against VS main (dotnet/razor#11640) so figured I'd prevent this breaking Roslyn too, at whatever point in the future the VS image is updated.
2 parents 06a1104 + 29d0a35 commit 121ba61

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/VisualStudio/IntegrationTest/New.IntegrationTests/InProcess/FindReferencesWindowInProcess.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ private async Task<IWpfTableControl2> GetFindReferencesWindowAsync(CancellationT
8282

8383
// Dig through to get the Find References control.
8484
var toolWindowType = toolWindow.GetType();
85-
var toolWindowControlField = toolWindowType.GetField("Control");
85+
var toolWindowControlField = toolWindowType.GetField("_control") ?? toolWindowType.GetField("Control");
8686
var toolWindowControl = toolWindowControlField.GetValue(toolWindow);
8787

8888
// Dig further to get the results table (as opposed to the toolbar).

0 commit comments

Comments
 (0)