0
Vote

ShoppingCart:There are some warnings in code analysis after the conversion to vs2008 solution.

description

Environment:

1.     Windows2003 ENT ENU
2.     Katmai build 10.00.1600.22
3.     Sample build 090228
4.     VS2008 9.0.30708.1 SP
 

Steps:

1.    Locate to "..\Samples\Engine\ServiceBroker\ShoppingCart"
2.    Open the "ShoppingCartCS.sln" with vs2008, convert it to vs2008 by default steps.
3.    Run code analysis the project "ServiceBrokerInterface", "ShoppingCartClient" and "ShoppingCartService".
4.    Check the analysis result.
 

Expections:

All the analysis results should be "0 Error, 0 Warning, 0 Messages".
 

Actual Results:

ServiceBrokerInterface "0 Error, 3 Warning, 0 Messages"
ShoppingCartClient  "0 Error, 5 Warning, 0 Messages"
ShoppingCartService "0 Error, 4 Warning, 0 Messages"
See the attached file "a_ShoppingCart.txt" for the detail.
 

Comment(2009-3-16 added by libinzhao_cp):

The sample solution "ShoppingCartCS.sln" has been converted to vs2008 on the sample 90315, update the results of code analysis:
 
ServiceBrokerInterface "0 Error, 1 Warning, 0 Messages"
  Warning       1       CA1704 : Microsoft.Naming : Correct the spelling of 'Waitfor' in member name 'Service.WaitforTimeout' or remove it entirely if it represents any sort of Hungarian notation.         C:\Program Files\Microsoft SQL Server\100\Samples\Engine\ServiceBroker\ServiceBrokerInterface\cs\ServiceBrokerInterface\Service.cs         118         ServiceBrokerInterface
 
ShoppingCartClient  "0 Error, 3 Warning, 0 Messages"
  Warning       1       CA1704 : Microsoft.Naming : Correct the spelling of 'Waitfor' in member name 'Service.WaitforTimeout' or remove it entirely if it represents any sort of Hungarian notation.         C:\Program Files\Microsoft SQL Server\100\Samples\Engine\ServiceBroker\ServiceBrokerInterface\cs\ServiceBrokerInterface\Service.cs         118         ServiceBrokerInterface
  Warning       2       CA1824 : Microsoft.Performance : Because assembly 'ShoppingCartClient.exe' contains a ResX-based resource file, mark it with the NeutralResourcesLanguage attribute, specifying the language of the resources within the assembly. This could improve lookup performance the first time a resource is retrieved.      ShoppingCartClient
  Warning       3       CA1031 : Microsoft.Design : Modify 'Program.Main()' to catch a more specific exception than 'Exception' or rethrow the exception.   C:\Program Files\Microsoft SQL Server\100\Samples\Engine\ServiceBroker\ShoppingCart\ShoppingCartClient\CS\ShoppingCartClient\Program.cs  39         ShoppingCartClient
 
ShoppingCartService "0 Error, 2 Warning, 0 Messages"
  Warning       1       CA1704 : Microsoft.Naming : Correct the spelling of 'Waitfor' in member name 'Service.WaitforTimeout' or remove it entirely if it represents any sort of Hungarian notation.         C:\Program Files\Microsoft SQL Server\100\Samples\Engine\ServiceBroker\ServiceBrokerInterface\cs\ServiceBrokerInterface\Service.cs         118         ServiceBrokerInterface
  Warning       2       CA1704 : Microsoft.Naming : In method 'ShoppingCartService.ShoppingCartService(SqlConnection)', correct the spelling of 'conn' in parameter name 'conn' or remove it entirely if it represents any sort of Hungarian notation.      C:\Program Files\Microsoft SQL Server\100\Samples\Engine\ServiceBroker\ShoppingCart\ShoppingCartService\CS\ShoppingCartService\ShoppingCartService.cs   51         ShoppingCartService

file attachments

comments

wrote Mar 16, 2009 at 9:11 AM

The sample solution "ShoppingCartCS.sln" has been converted to vs2008 on the sample 90315, update the results of code analysis:
 
ServiceBrokerInterface "0 Error, 1 Warning, 0 Messages"
  Warning       1       CA1704 : Microsoft.Naming : Correct the spelling of 'Waitfor' in member name 'Service.WaitforTimeout' or remove it entirely if it represents any sort of Hungarian notation.         C:\Program Files\Microsoft SQL Server\100\Samples\Engine\ServiceBroker\ServiceBrokerInterface\cs\ServiceBrokerInterface\Service.cs         118         ServiceBrokerInterface
 
ShoppingCartClient  "0 Error, 3 Warning, 0 Messages"
  Warning       1       CA1704 : Microsoft.Naming : Correct the spelling of 'Waitfor' in member name 'Service.WaitforTimeout' or remove it entirely if it represents any sort of Hungarian notation.         C:\Program Files\Microsoft SQL Server\100\Samples\Engine\ServiceBroker\ServiceBrokerInterface\cs\ServiceBrokerInterface\Service.cs         118         ServiceBrokerInterface
  Warning       2       CA1824 : Microsoft.Performance : Because assembly 'ShoppingCartClient.exe' contains a ResX-based resource file, mark it with the NeutralResourcesLanguage attribute, specifying the language of the resources within the assembly. This could improve lookup performance the first time a resource is retrieved.      ShoppingCartClient
  Warning       3       CA1031 : Microsoft.Design : Modify 'Program.Main()' to catch a more specific exception than 'Exception' or rethrow the exception.   C:\Program Files\Microsoft SQL Server\100\Samples\Engine\ServiceBroker\ShoppingCart\ShoppingCartClient\CS\ShoppingCartClient\Program.cs  39         ShoppingCartClient
 
ShoppingCartService "0 Error, 2 Warning, 0 Messages"
  Warning       1       CA1704 : Microsoft.Naming : Correct the spelling of 'Waitfor' in member name 'Service.WaitforTimeout' or remove it entirely if it represents any sort of Hungarian notation.         C:\Program Files\Microsoft SQL Server\100\Samples\Engine\ServiceBroker\ServiceBrokerInterface\cs\ServiceBrokerInterface\Service.cs         118         ServiceBrokerInterface
  Warning       2       CA1704 : Microsoft.Naming : In method 'ShoppingCartService.ShoppingCartService(SqlConnection)', correct the spelling of 'conn' in parameter name 'conn' or remove it entirely if it represents any sort of Hungarian notation.      C:\Program Files\Microsoft SQL Server\100\Samples\Engine\ServiceBroker\ShoppingCart\ShoppingCartService\CS\ShoppingCartService\ShoppingCartService.cs   51         ShoppingCartService