Code Analysis does not Enforce Rules on Async Methods - by John Koerner

Status : 

  Won't Fix<br /><br />
		Due to several factors the product team decided to focus its efforts on other items.<br /><br />
		A more detailed explanation for the resolution of this particular item may have been provided in the comments section.


5
0
Sign in
to vote
ID 835677 Comments
Status Closed Workarounds
Type Bug Repros 0
Opened 3/17/2014 1:57:16 PM
Access Restriction Public

Description

When running code analysis on a project in Visual Studio 2013, if a method is Async, then code analysis rules are not triggered for that code.
Sign in to post a comment.
Posted by Microsoft on 6/30/2014 at 6:42 PM
Hi John,

Thanks for your feedback here!

Unfortunately, there are many known issues with FxCop when analyzing async methods, mostly regarding the heavy transforms that the compiler does on your behalf to produce the state machine that powers your async method. Fixing up FxCop directly there is a dead-end - the real solution is to analyze your source code instead. For VS "14", we're exploring that path, with source analysis based on the Roslyn APIs. When that analysis is available, rules will be able to effectively surface issues that occur inside async methods.

Alex Turner
Senior Program Manager
Visual Basic and C# Compiler
Posted by Microsoft on 3/19/2014 at 12:46 AM
Thank you for submitting feedback on Visual Studio and .NET Framework. Your issue has been reproduced and has been routed to the appropriate VS development team for review. We will contact you if we require any additional information. If you require immediate assistance with this issue, please contact product support at http://support.microsoft.com/ph/1117.
Posted by John Koerner on 3/18/2014 at 6:48 AM
Please make sure you have the code analysis ruleset set to All Rules. Also, I added an attachment with a sample project.
Posted by Microsoft on 3/18/2014 at 12:31 AM
Hi John,

Thank you for submitting feedback on Visual Studio and .NET Framework. According to the information you have provided, we couldn't get the CA1303. In order to efficiently investigate and reproduce this issue, we are requesting additional information outlined below.

Could you please give us a demo project to demonstrate this issue so that we can conduct further research?

Please submit this information to us within 4 business days. We look forward to hearing from you with this information. If you require immediate assistance with this issue, please contact product support at http://support.microsoft.com/ph/1117.
Posted by Microsoft on 3/17/2014 at 6:38 PM
Thank you for your feedback, we are currently reviewing the issue you have submitted. If this issue is urgent, please contact support directly(http://support.microsoft.com)