3 ms·
"Would be nice if calling an async void method directly threw a compiler warning to make this completely clear." With VS 2015 and Roslyn, you can easily achiev
by pionar 11y ago
"Would be nice if calling an async void method directly threw a compiler warning to make this completely clear."
With VS 2015 and Roslyn, you can easily achieve this. In fact, there's already sample code to do this in the roslyn samples project[0].
[0]https://github.com/dotnet/roslyn/tree/master/src/Samples/CSharp/AsyncPackage https://github.com/dotnet/roslyn/tree/master/src/Samples/CSh...
- JonathonW 11y agoThe ability to write my own analyzers shouldn't be a substitute for a well-curated set of code analysis checks out of the box, though. I want to spend my time building my product, not building the tooling so I can build my product. (Note that I haven't had the opportunity to play with VS2015 yet; for all I know, these checks from the Roslyn samples might already be provided with the IDE.)
- Locke1689 11y agoAnalyzers are available as NuGet packages, so it should be a trivial process to install one of these in your project. We're definitely going to start shipping some high-value analyzers in the box (probably including the async-void one).