Visual Studio 2005 SP1 Bug Fixes

Following Brian Harry's lead and transparency, below is list of Managed Code Analysis fixes that made it into Visual Studio 2005 Service Pack 1

Analysis

  • FxCop reporting CA1811 on private const, while const is being used in code.
  • Microsoft.VisualBasic.ComClassAttribute cause VB.NET compiler to generate code that doesn't comply with design rules and gets noisy in FxCop
  • Line numbers for unnecessary initialization rule incorrectly use first initialization
  • False positive of AvoidUnusedPrivateCode on designer code
  • ImplementIDisposableCorrectly doesn't fire on generic types
  • False positive for duplicate accelerator rule on new whidbey menu strips
  • False positives around generics operators
  • RuleUtilities.IsLocalized should be robust against nullness issues
  • Do not cast unnecessarily doesn't fire on generic locals & parameters
  • ImplementIDisposableCorrectly should allow Dispose reimplementation if it does not affect the dispatching for calls through the base class
  • We should ignore VB event accessor overrides have parameters that do not match base declaration
  • Generic Methods Should Provide Type Parameter fires false positives and has false negatives
  • NullReferenceException in Microsoft.FxCop.Sdk.Introspection.RuleUtilities.SkipArgument(Method caller, Int32 offset)
  • Code Analysis reports CA1063 for generic types even when IDisposable is properly implemented.
  • MethodSecurityShouldBeASupersetOfType should not fire on all permission differences between a method and its type
  • ValidateArgumentsOfPublicMethods incorrectly fires on structs passed by reference
  • ProvideCorrectArgumentsToFormattingMethods throws exception when run over String.Format variations that use Type arguments
  • DoNotInitializeUnnecessarily incorrectly fires on members that have previously been assigned
  • UsePropertiesWhereAppropriate incorrectly firing on SetXXX method with single array parameter
  • ImplementISerializableCorrectly and ImplementSerializationConstructors should not fire on derived classes where the base does not provide an overridable version of GetObjectData or a serialization constructor
  • AvoidUnusedPrivateFields incorrectly fires on 'constant' Decimals
  • PInvokeEntryPointsShouldExist inconsistantly throws an exception on certain pinvoke signatures
  • PInvokeEntryPointsShouldExist rule does not handle stdcall mangling correctly for arguments smaller than 4 bytes
  • Runing FxCop on Device Application 1.0 returns an error out of the box.
  • RethrowToPreserveStackDetails throws exception when analyzing nested try...catch clauses
  • StackOverflowException is thrown when FxCop analyzes generic code that has where clauses that use type parameters in where clause

Visual Studio Integration

  • Enabling code analysis in a C++ project in VSTS and then building on Pro causes an error
  • Fail to do FxCop on v1.1 CLR assembly in ASP.NET scenario.
  • FxCop retuns error code 1024 for Visual Basic web project
  • NullReferenceException thrown when running code analysis during build of project in Team Edition for Sofware Architects
  • Code Analysis Warnings sometimes fail to show up in ErrorList due to Errorlist/Tasklist DCR (introduced in SP1)