Home Dashboard Directory Help

Code Analysis rule CA1305 is missed for TryParse by David Lowndes



Sign in
to vote
Type: Bug
ID: 788373
Opened: 5/22/2013 2:36:20 AM
Access Restriction: Public
User(s) can reproduce this bug


Given these lines of C# code:

double dv = Double.Parse( "2.5" );
if ( Double.TryParse( "2.5", out dv ) )

If you run Code Analysis (with rule CA1305 enabled), it's only identified for the Double.Parse line.
Sign in to post a comment.
Posted by Microsoft on 7/12/2013 at 9:37 AM
Thanks for reporting this issue you've encountered with Visual Studio!

We could indeed expand CA1305 to cover TryParse as well. Unfortunately, at this point in the next Visual Studio release, we're starting to lock down on what issues we can fix, and we won't be able to clean up this rule this time around. We'll definitely keep this issue in mind when planning for our next release!

Alex Turner
Senior Program Manager
Visual Basic and C# Compiler
Posted by Microsoft on 5/22/2013 at 7:57 PM
Thanks for your feedback.

We are rerouting this issue to the appropriate group within the Visual Studio Product Team for triage and resolution. These specialized experts will follow-up with your issue.
Posted by Microsoft on 5/22/2013 at 12:53 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)
Sign in to post a workaround.