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












53














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.










share|improve this question




















  • 14




    Asynchronous code is now so ubiquitous that I don't see it as a practice anymore, unless you really have both versions.
    – Adrian Iftode
    Dec 29 '18 at 20:20










  • By "doesn't end Async", do you mean, the name of the method doesn't end in Async?
    – Lasse Vågsæther Karlsen
    Dec 29 '18 at 20:57






  • 3




    "It's the recommended convention for async methods" is it? It's kind of assumed, now.
    – Alexander
    Dec 30 '18 at 0:05






  • 1




    What we can do using Visual Studio Text Editor configurations or .editorconfig file, is limited to warn about methods with async modifier, we cannot apply the rule for methods which return Task.
    – Reza Aghaei
    Dec 30 '18 at 0:17






  • 3




    @rory.ap No, I'm suggesting that asynchronous calls are so common now that it doesn't warrant special treatment. You naturally think about checking which classes a method belongs to, what its return type is, etc. Yet we don't annotate method names with what classes they belong to, or what their arg and return types are. I'm saying to give async the same treatment. It's just "one of those things" you check on a function when you learn how to use it, without it being called out explicitly in a name.
    – Alexander
    Dec 30 '18 at 22:25
















53














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.










share|improve this question




















  • 14




    Asynchronous code is now so ubiquitous that I don't see it as a practice anymore, unless you really have both versions.
    – Adrian Iftode
    Dec 29 '18 at 20:20










  • By "doesn't end Async", do you mean, the name of the method doesn't end in Async?
    – Lasse Vågsæther Karlsen
    Dec 29 '18 at 20:57






  • 3




    "It's the recommended convention for async methods" is it? It's kind of assumed, now.
    – Alexander
    Dec 30 '18 at 0:05






  • 1




    What we can do using Visual Studio Text Editor configurations or .editorconfig file, is limited to warn about methods with async modifier, we cannot apply the rule for methods which return Task.
    – Reza Aghaei
    Dec 30 '18 at 0:17






  • 3




    @rory.ap No, I'm suggesting that asynchronous calls are so common now that it doesn't warrant special treatment. You naturally think about checking which classes a method belongs to, what its return type is, etc. Yet we don't annotate method names with what classes they belong to, or what their arg and return types are. I'm saying to give async the same treatment. It's just "one of those things" you check on a function when you learn how to use it, without it being called out explicitly in a name.
    – Alexander
    Dec 30 '18 at 22:25














53












53








53


20





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.










share|improve this question















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.







c# visual-studio asynchronous






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Dec 30 '18 at 0:45









Peter Mortensen

13.5k1983111




13.5k1983111










asked Dec 29 '18 at 20:01









Jez

11.7k1881151




11.7k1881151








  • 14




    Asynchronous code is now so ubiquitous that I don't see it as a practice anymore, unless you really have both versions.
    – Adrian Iftode
    Dec 29 '18 at 20:20










  • By "doesn't end Async", do you mean, the name of the method doesn't end in Async?
    – Lasse Vågsæther Karlsen
    Dec 29 '18 at 20:57






  • 3




    "It's the recommended convention for async methods" is it? It's kind of assumed, now.
    – Alexander
    Dec 30 '18 at 0:05






  • 1




    What we can do using Visual Studio Text Editor configurations or .editorconfig file, is limited to warn about methods with async modifier, we cannot apply the rule for methods which return Task.
    – Reza Aghaei
    Dec 30 '18 at 0:17






  • 3




    @rory.ap No, I'm suggesting that asynchronous calls are so common now that it doesn't warrant special treatment. You naturally think about checking which classes a method belongs to, what its return type is, etc. Yet we don't annotate method names with what classes they belong to, or what their arg and return types are. I'm saying to give async the same treatment. It's just "one of those things" you check on a function when you learn how to use it, without it being called out explicitly in a name.
    – Alexander
    Dec 30 '18 at 22:25














  • 14




    Asynchronous code is now so ubiquitous that I don't see it as a practice anymore, unless you really have both versions.
    – Adrian Iftode
    Dec 29 '18 at 20:20










  • By "doesn't end Async", do you mean, the name of the method doesn't end in Async?
    – Lasse Vågsæther Karlsen
    Dec 29 '18 at 20:57






  • 3




    "It's the recommended convention for async methods" is it? It's kind of assumed, now.
    – Alexander
    Dec 30 '18 at 0:05






  • 1




    What we can do using Visual Studio Text Editor configurations or .editorconfig file, is limited to warn about methods with async modifier, we cannot apply the rule for methods which return Task.
    – Reza Aghaei
    Dec 30 '18 at 0:17






  • 3




    @rory.ap No, I'm suggesting that asynchronous calls are so common now that it doesn't warrant special treatment. You naturally think about checking which classes a method belongs to, what its return type is, etc. Yet we don't annotate method names with what classes they belong to, or what their arg and return types are. I'm saying to give async the same treatment. It's just "one of those things" you check on a function when you learn how to use it, without it being called out explicitly in a name.
    – Alexander
    Dec 30 '18 at 22:25








14




14




Asynchronous code is now so ubiquitous that I don't see it as a practice anymore, unless you really have both versions.
– Adrian Iftode
Dec 29 '18 at 20:20




Asynchronous code is now so ubiquitous that I don't see it as a practice anymore, unless you really have both versions.
– Adrian Iftode
Dec 29 '18 at 20:20












By "doesn't end Async", do you mean, the name of the method doesn't end in Async?
– Lasse Vågsæther Karlsen
Dec 29 '18 at 20:57




By "doesn't end Async", do you mean, the name of the method doesn't end in Async?
– Lasse Vågsæther Karlsen
Dec 29 '18 at 20:57




3




3




"It's the recommended convention for async methods" is it? It's kind of assumed, now.
– Alexander
Dec 30 '18 at 0:05




"It's the recommended convention for async methods" is it? It's kind of assumed, now.
– Alexander
Dec 30 '18 at 0:05




1




1




What we can do using Visual Studio Text Editor configurations or .editorconfig file, is limited to warn about methods with async modifier, we cannot apply the rule for methods which return Task.
– Reza Aghaei
Dec 30 '18 at 0:17




What we can do using Visual Studio Text Editor configurations or .editorconfig file, is limited to warn about methods with async modifier, we cannot apply the rule for methods which return Task.
– Reza Aghaei
Dec 30 '18 at 0:17




3




3




@rory.ap No, I'm suggesting that asynchronous calls are so common now that it doesn't warrant special treatment. You naturally think about checking which classes a method belongs to, what its return type is, etc. Yet we don't annotate method names with what classes they belong to, or what their arg and return types are. I'm saying to give async the same treatment. It's just "one of those things" you check on a function when you learn how to use it, without it being called out explicitly in a name.
– Alexander
Dec 30 '18 at 22:25




@rory.ap No, I'm suggesting that asynchronous calls are so common now that it doesn't warrant special treatment. You naturally think about checking which classes a method belongs to, what its return type is, etc. Yet we don't annotate method names with what classes they belong to, or what their arg and return types are. I'm saying to give async the same treatment. It's just "one of those things" you check on a function when you learn how to use it, without it being called out explicitly in a name.
– Alexander
Dec 30 '18 at 22:25












2 Answers
2






active

oldest

votes


















76














From Options,




  • Go to Text EditorBasicCode 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


Enter image description here



Enter image description here



Enter image description here






share|improve this answer



















  • 1




    Despite all these up-votes don't see how it works for me. No suggestions, warning, errors - nothing
    – Kamarey
    Jan 1 at 9:23










  • @Kamarey after applying this rule. try closing your editor, reopen it and delete one of your async method without Async postfix and try adding again. It will start working, you may also consider to change severity to Warning.
    – Simonare
    2 days ago





















20














In addition to Visual Studio Text Editor Settings, you can create portable, custom editor settings .editorconfig file. Visual Studio 2017 natively supports .editorconfig files.



By creating the .editorconfig file as part of the repository and pushing it to the repository, you can enforce consistent coding styles for everyone that works in that codebase, regardless of their Visual Studio Text Editor Settings.




The Coding conventions you use on your personal projects may differ from
those used on your team's projects. EditorConfig files resolve this
problem by enabling you to have a configuration for each scenario.







EditorConfig settings take precedence over global Visual Studio text
editor settings.




To do so:




  1. In the Solution Explorer, select the Solution, Project or a folder in project, depending to the scope which you want to apply the naming rule.


  2. Right click and select Add New Item or Press Ctrl + Shift + A


  3. Choose Text File file from General categories and enter .editorconfig as file name.


Note: The file location can be even in parent folder of your solution. It's not necessary to have it in solution.



Paste the following content in the file:



# Top-most EditorConfig file
root = true

[*.{cs,vb}]

# Async methods should have "Async" suffix
dotnet_naming_rule.async_methods_end_in_async.symbols = any_async_methods
dotnet_naming_rule.async_methods_end_in_async.style = end_in_async
dotnet_naming_rule.async_methods_end_in_async.severity = suggestion

dotnet_naming_symbols.any_async_methods.applicable_kinds = method
dotnet_naming_symbols.any_async_methods.applicable_accessibilities = *
dotnet_naming_symbols.any_async_methods.required_modifiers = async

dotnet_naming_style.end_in_async.required_prefix =
dotnet_naming_style.end_in_async.required_suffix = Async
dotnet_naming_style.end_in_async.capitalization = pascal_case
dotnet_naming_style.end_in_async.word_separator =


More Information:




  • Create portable, custom editor settings with EditorConfig

  • EditorConfig






share|improve this answer























  • Example
    – Reza Aghaei
    Dec 29 '18 at 21:17










  • I discovered that actually, you don't need to "Add new item", you literally just need to drop the .editorconfig file in the same directory as the .sln file and it is detected.
    – Jez
    Dec 30 '18 at 21:52










  • The file location can be even in parent folder of your solution. It's not necessary to have it in solution folder structure. Putting in project structure is just for having it available in VS to edit it.
    – Reza Aghaei
    Dec 31 '18 at 2:44











Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53972941%2fhow-do-i-get-a-warning-in-visual-studio-when-async-methods-dont-end-in-async%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























2 Answers
2






active

oldest

votes








2 Answers
2






active

oldest

votes









active

oldest

votes






active

oldest

votes









76














From Options,




  • Go to Text EditorBasicCode 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


Enter image description here



Enter image description here



Enter image description here






share|improve this answer



















  • 1




    Despite all these up-votes don't see how it works for me. No suggestions, warning, errors - nothing
    – Kamarey
    Jan 1 at 9:23










  • @Kamarey after applying this rule. try closing your editor, reopen it and delete one of your async method without Async postfix and try adding again. It will start working, you may also consider to change severity to Warning.
    – Simonare
    2 days ago


















76














From Options,




  • Go to Text EditorBasicCode 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


Enter image description here



Enter image description here



Enter image description here






share|improve this answer



















  • 1




    Despite all these up-votes don't see how it works for me. No suggestions, warning, errors - nothing
    – Kamarey
    Jan 1 at 9:23










  • @Kamarey after applying this rule. try closing your editor, reopen it and delete one of your async method without Async postfix and try adding again. It will start working, you may also consider to change severity to Warning.
    – Simonare
    2 days ago
















76












76








76






From Options,




  • Go to Text EditorBasicCode 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


Enter image description here



Enter image description here



Enter image description here






share|improve this answer














From Options,




  • Go to Text EditorBasicCode 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


Enter image description here



Enter image description here



Enter image description here







share|improve this answer














share|improve this answer



share|improve this answer








edited Dec 30 '18 at 0:30









Peter Mortensen

13.5k1983111




13.5k1983111










answered Dec 29 '18 at 20:19









Simonare

5,70211435




5,70211435








  • 1




    Despite all these up-votes don't see how it works for me. No suggestions, warning, errors - nothing
    – Kamarey
    Jan 1 at 9:23










  • @Kamarey after applying this rule. try closing your editor, reopen it and delete one of your async method without Async postfix and try adding again. It will start working, you may also consider to change severity to Warning.
    – Simonare
    2 days ago
















  • 1




    Despite all these up-votes don't see how it works for me. No suggestions, warning, errors - nothing
    – Kamarey
    Jan 1 at 9:23










  • @Kamarey after applying this rule. try closing your editor, reopen it and delete one of your async method without Async postfix and try adding again. It will start working, you may also consider to change severity to Warning.
    – Simonare
    2 days ago










1




1




Despite all these up-votes don't see how it works for me. No suggestions, warning, errors - nothing
– Kamarey
Jan 1 at 9:23




Despite all these up-votes don't see how it works for me. No suggestions, warning, errors - nothing
– Kamarey
Jan 1 at 9:23












@Kamarey after applying this rule. try closing your editor, reopen it and delete one of your async method without Async postfix and try adding again. It will start working, you may also consider to change severity to Warning.
– Simonare
2 days ago






@Kamarey after applying this rule. try closing your editor, reopen it and delete one of your async method without Async postfix and try adding again. It will start working, you may also consider to change severity to Warning.
– Simonare
2 days ago















20














In addition to Visual Studio Text Editor Settings, you can create portable, custom editor settings .editorconfig file. Visual Studio 2017 natively supports .editorconfig files.



By creating the .editorconfig file as part of the repository and pushing it to the repository, you can enforce consistent coding styles for everyone that works in that codebase, regardless of their Visual Studio Text Editor Settings.




The Coding conventions you use on your personal projects may differ from
those used on your team's projects. EditorConfig files resolve this
problem by enabling you to have a configuration for each scenario.







EditorConfig settings take precedence over global Visual Studio text
editor settings.




To do so:




  1. In the Solution Explorer, select the Solution, Project or a folder in project, depending to the scope which you want to apply the naming rule.


  2. Right click and select Add New Item or Press Ctrl + Shift + A


  3. Choose Text File file from General categories and enter .editorconfig as file name.


Note: The file location can be even in parent folder of your solution. It's not necessary to have it in solution.



Paste the following content in the file:



# Top-most EditorConfig file
root = true

[*.{cs,vb}]

# Async methods should have "Async" suffix
dotnet_naming_rule.async_methods_end_in_async.symbols = any_async_methods
dotnet_naming_rule.async_methods_end_in_async.style = end_in_async
dotnet_naming_rule.async_methods_end_in_async.severity = suggestion

dotnet_naming_symbols.any_async_methods.applicable_kinds = method
dotnet_naming_symbols.any_async_methods.applicable_accessibilities = *
dotnet_naming_symbols.any_async_methods.required_modifiers = async

dotnet_naming_style.end_in_async.required_prefix =
dotnet_naming_style.end_in_async.required_suffix = Async
dotnet_naming_style.end_in_async.capitalization = pascal_case
dotnet_naming_style.end_in_async.word_separator =


More Information:




  • Create portable, custom editor settings with EditorConfig

  • EditorConfig






share|improve this answer























  • Example
    – Reza Aghaei
    Dec 29 '18 at 21:17










  • I discovered that actually, you don't need to "Add new item", you literally just need to drop the .editorconfig file in the same directory as the .sln file and it is detected.
    – Jez
    Dec 30 '18 at 21:52










  • The file location can be even in parent folder of your solution. It's not necessary to have it in solution folder structure. Putting in project structure is just for having it available in VS to edit it.
    – Reza Aghaei
    Dec 31 '18 at 2:44
















20














In addition to Visual Studio Text Editor Settings, you can create portable, custom editor settings .editorconfig file. Visual Studio 2017 natively supports .editorconfig files.



By creating the .editorconfig file as part of the repository and pushing it to the repository, you can enforce consistent coding styles for everyone that works in that codebase, regardless of their Visual Studio Text Editor Settings.




The Coding conventions you use on your personal projects may differ from
those used on your team's projects. EditorConfig files resolve this
problem by enabling you to have a configuration for each scenario.







EditorConfig settings take precedence over global Visual Studio text
editor settings.




To do so:




  1. In the Solution Explorer, select the Solution, Project or a folder in project, depending to the scope which you want to apply the naming rule.


  2. Right click and select Add New Item or Press Ctrl + Shift + A


  3. Choose Text File file from General categories and enter .editorconfig as file name.


Note: The file location can be even in parent folder of your solution. It's not necessary to have it in solution.



Paste the following content in the file:



# Top-most EditorConfig file
root = true

[*.{cs,vb}]

# Async methods should have "Async" suffix
dotnet_naming_rule.async_methods_end_in_async.symbols = any_async_methods
dotnet_naming_rule.async_methods_end_in_async.style = end_in_async
dotnet_naming_rule.async_methods_end_in_async.severity = suggestion

dotnet_naming_symbols.any_async_methods.applicable_kinds = method
dotnet_naming_symbols.any_async_methods.applicable_accessibilities = *
dotnet_naming_symbols.any_async_methods.required_modifiers = async

dotnet_naming_style.end_in_async.required_prefix =
dotnet_naming_style.end_in_async.required_suffix = Async
dotnet_naming_style.end_in_async.capitalization = pascal_case
dotnet_naming_style.end_in_async.word_separator =


More Information:




  • Create portable, custom editor settings with EditorConfig

  • EditorConfig






share|improve this answer























  • Example
    – Reza Aghaei
    Dec 29 '18 at 21:17










  • I discovered that actually, you don't need to "Add new item", you literally just need to drop the .editorconfig file in the same directory as the .sln file and it is detected.
    – Jez
    Dec 30 '18 at 21:52










  • The file location can be even in parent folder of your solution. It's not necessary to have it in solution folder structure. Putting in project structure is just for having it available in VS to edit it.
    – Reza Aghaei
    Dec 31 '18 at 2:44














20












20








20






In addition to Visual Studio Text Editor Settings, you can create portable, custom editor settings .editorconfig file. Visual Studio 2017 natively supports .editorconfig files.



By creating the .editorconfig file as part of the repository and pushing it to the repository, you can enforce consistent coding styles for everyone that works in that codebase, regardless of their Visual Studio Text Editor Settings.




The Coding conventions you use on your personal projects may differ from
those used on your team's projects. EditorConfig files resolve this
problem by enabling you to have a configuration for each scenario.







EditorConfig settings take precedence over global Visual Studio text
editor settings.




To do so:




  1. In the Solution Explorer, select the Solution, Project or a folder in project, depending to the scope which you want to apply the naming rule.


  2. Right click and select Add New Item or Press Ctrl + Shift + A


  3. Choose Text File file from General categories and enter .editorconfig as file name.


Note: The file location can be even in parent folder of your solution. It's not necessary to have it in solution.



Paste the following content in the file:



# Top-most EditorConfig file
root = true

[*.{cs,vb}]

# Async methods should have "Async" suffix
dotnet_naming_rule.async_methods_end_in_async.symbols = any_async_methods
dotnet_naming_rule.async_methods_end_in_async.style = end_in_async
dotnet_naming_rule.async_methods_end_in_async.severity = suggestion

dotnet_naming_symbols.any_async_methods.applicable_kinds = method
dotnet_naming_symbols.any_async_methods.applicable_accessibilities = *
dotnet_naming_symbols.any_async_methods.required_modifiers = async

dotnet_naming_style.end_in_async.required_prefix =
dotnet_naming_style.end_in_async.required_suffix = Async
dotnet_naming_style.end_in_async.capitalization = pascal_case
dotnet_naming_style.end_in_async.word_separator =


More Information:




  • Create portable, custom editor settings with EditorConfig

  • EditorConfig






share|improve this answer














In addition to Visual Studio Text Editor Settings, you can create portable, custom editor settings .editorconfig file. Visual Studio 2017 natively supports .editorconfig files.



By creating the .editorconfig file as part of the repository and pushing it to the repository, you can enforce consistent coding styles for everyone that works in that codebase, regardless of their Visual Studio Text Editor Settings.




The Coding conventions you use on your personal projects may differ from
those used on your team's projects. EditorConfig files resolve this
problem by enabling you to have a configuration for each scenario.







EditorConfig settings take precedence over global Visual Studio text
editor settings.




To do so:




  1. In the Solution Explorer, select the Solution, Project or a folder in project, depending to the scope which you want to apply the naming rule.


  2. Right click and select Add New Item or Press Ctrl + Shift + A


  3. Choose Text File file from General categories and enter .editorconfig as file name.


Note: The file location can be even in parent folder of your solution. It's not necessary to have it in solution.



Paste the following content in the file:



# Top-most EditorConfig file
root = true

[*.{cs,vb}]

# Async methods should have "Async" suffix
dotnet_naming_rule.async_methods_end_in_async.symbols = any_async_methods
dotnet_naming_rule.async_methods_end_in_async.style = end_in_async
dotnet_naming_rule.async_methods_end_in_async.severity = suggestion

dotnet_naming_symbols.any_async_methods.applicable_kinds = method
dotnet_naming_symbols.any_async_methods.applicable_accessibilities = *
dotnet_naming_symbols.any_async_methods.required_modifiers = async

dotnet_naming_style.end_in_async.required_prefix =
dotnet_naming_style.end_in_async.required_suffix = Async
dotnet_naming_style.end_in_async.capitalization = pascal_case
dotnet_naming_style.end_in_async.word_separator =


More Information:




  • Create portable, custom editor settings with EditorConfig

  • EditorConfig







share|improve this answer














share|improve this answer



share|improve this answer








edited Dec 31 '18 at 2:57

























answered Dec 29 '18 at 20:46









Reza Aghaei

64.5k851154




64.5k851154












  • Example
    – Reza Aghaei
    Dec 29 '18 at 21:17










  • I discovered that actually, you don't need to "Add new item", you literally just need to drop the .editorconfig file in the same directory as the .sln file and it is detected.
    – Jez
    Dec 30 '18 at 21:52










  • The file location can be even in parent folder of your solution. It's not necessary to have it in solution folder structure. Putting in project structure is just for having it available in VS to edit it.
    – Reza Aghaei
    Dec 31 '18 at 2:44


















  • Example
    – Reza Aghaei
    Dec 29 '18 at 21:17










  • I discovered that actually, you don't need to "Add new item", you literally just need to drop the .editorconfig file in the same directory as the .sln file and it is detected.
    – Jez
    Dec 30 '18 at 21:52










  • The file location can be even in parent folder of your solution. It's not necessary to have it in solution folder structure. Putting in project structure is just for having it available in VS to edit it.
    – Reza Aghaei
    Dec 31 '18 at 2:44
















Example
– Reza Aghaei
Dec 29 '18 at 21:17




Example
– Reza Aghaei
Dec 29 '18 at 21:17












I discovered that actually, you don't need to "Add new item", you literally just need to drop the .editorconfig file in the same directory as the .sln file and it is detected.
– Jez
Dec 30 '18 at 21:52




I discovered that actually, you don't need to "Add new item", you literally just need to drop the .editorconfig file in the same directory as the .sln file and it is detected.
– Jez
Dec 30 '18 at 21:52












The file location can be even in parent folder of your solution. It's not necessary to have it in solution folder structure. Putting in project structure is just for having it available in VS to edit it.
– Reza Aghaei
Dec 31 '18 at 2:44




The file location can be even in parent folder of your solution. It's not necessary to have it in solution folder structure. Putting in project structure is just for having it available in VS to edit it.
– Reza Aghaei
Dec 31 '18 at 2:44


















draft saved

draft discarded




















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.





Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


Please pay close attention to the following guidance:


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53972941%2fhow-do-i-get-a-warning-in-visual-studio-when-async-methods-dont-end-in-async%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Human spaceflight

Can not write log (Is /dev/pts mounted?) - openpty in Ubuntu-on-Windows?

張江高科駅