Open
Description
openedon Jan 17, 2019
Bug description
The analyzer for VSTHRD010 is only checking for the existence of a main thread switching call above the offending code. But that's not sufficient if the code were to also switch to a worker thread after having switched to the main thread.
Repro steps
public async Task TestAsync(EnvDTE.DTE dte)
{
await ThreadHelper.JoinableTaskFactory.SwitchToMainThreadAsync();
await TaskScheduler.Default;
var debugger = dte.Debugger;
}
Expected behavior
A VSTHRD010 warning should occur for this code because the 3rd line is not running on the main thread.
Actual behavior
No warning is produced.
- Version used:
- Application (if applicable):
Additional context
Add any other context about the problem here.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment