Here is my code:
|
I appreciate the help
|
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Jaish MathewsPosted Jul 23, 2010, 11:08 AM
You are right. The supress message is for un used variables, not for non initialized variables. More over after any VS 2005 version you will get this error. Below link saying about that why made this change.
http://msdn.microsoft.com/en-us/library/4y7h161d.aspx
Sam HobbsPosted Jul 22, 2010, 3:58 PM
Are you sure that the message is just a warning? I thought that .Net requires that string objects be initialized.
Jaish MathewsPosted Jul 22, 2010, 3:18 PM
It was typo. I meant for message, not machine.
Right click on the error message displaying in VisualStudio and select supress message to skip that part by FxCop[This is the internal tool doing code analysis] .It may not available in express edition. But in team system version I am seeing it.
manas maadulPosted Jul 22, 2010, 11:16 AM
BenPosted Jul 22, 2010, 12:53 AM
Sam HobbsPosted Jul 21, 2010, 9:14 PM
Jaish MathewsPosted Jul 21, 2010, 4:13 AM
It's actually not additional code, but optional only. All code analysis mesages are optional. i.e. if you don't need VS to check some of code analysis, you can ternoff by right click on the machine and select supress. It may nt available in express edition. But in team system version I am seeing it.
Sam HobbsPosted Jul 20, 2010, 11:26 PM
theLizardPosted Jul 20, 2010, 6:17 PM
BenPosted Jul 20, 2010, 3:49 PM
Thanks a lot for the help
Jaish MathewsPosted Jul 20, 2010, 3:24 PM
That's a part of code performance checking from VS 2010. A variable is using without a default value. So u need to change ur declaration like below i.e. with default value
string anotherStr = string.Empty;