How to get a warning in Visual Studio when async methods don't end 'Async'?

  • A+
Category:Languages

How can I get Visual Studio to give me a naming warning each time I create an async method that doesn't end "Async"? It's the recommended convention for async methods but I often find myself forgetting to add that suffix and a warning would be useful.

 


from Options,

  • Go to Text Editor => Basic => Code Style => Naming
  • Select Manage Specifications and Add New Specification
  • Select Method, Tick All Accessability Options and From Modifiers Select Async
  • Give 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 then save
  • Now press plus sign and create new naming, Select specification as Async Method, select required Syle as AsyncPostfix and Severity as Suggestor.
  • Click Ok and save

How to get a warning in Visual Studio when async methods don't end 'Async'?

How to get a warning in Visual Studio when async methods don't end 'Async'?

How to get a warning in Visual Studio when async methods don't end 'Async'?

Comment

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen: