How can I get Visual Studio to give me a naming warning each time I create an asynchronous method that doesn't end "Async"?
It's the recommended convention for asynchronous methods, but I often find myself forgetting to add that suffix and a warning would be useful.
- Go to Text Editor → Basic → Code Style → Naming
- Select Manage Specifications and Add New Specification
- Select Method, tick all accessibility options and from Modifiers, select Async.
- Give the title as Async Method and save
- Now get into Manage Naming Styles and add New Style. Add Async as suffix and give it a name as AsyncSuffix, and then save
- Now press the plus sign and create new naming. Select specification as Async Method, select required Style as AsyncPostfix and Severity as Suggestor.
- Click OK and save