NOTE: This extension is no longer being updated. It is recommended to use the NuGet analyser package instead. When using dependency injection and async-await pattern it is possible to end up with an interface with a method that returns a Task. If this interface method is used in a synchronous method there is a likelihood that it will erroneously be run as a fire and forget method (which will not trigger inbuilt warning CS4014). In this situation this analyser generates a warning. It would be preferable to download the corresponding NuGet package to the relevant projects. This will then be referenced as an analyser that will run on all builds (this extension merely shows the warning when a code file is open, not on build). Example:
|