locked
Custom Code Analysis Rules - Not loading RRS feed

  • Question

  • I recently converted our DBPro custom code analysis rules project from VS 2008 to VS 2010. I modified the post build events as follows:

     

    copy "$(TargetDir)$(TargetName)$(TargetExt)" "$(ProgramFiles)\Microsoft Visual Studio 10.0\VSTSDB\Extensions\$(TargetName)$(TargetExt)" /y
    copy "$(ProjectDir)$(TargetName).Extensions.xml" "$(ProgramFiles)\Microsoft Visual Studio 10.0\VSTSDB\Extensions\$(TargetName).Extensions.xml" /y
    "C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Bin\NETFX 4.0 Tools\gacutil.exe" /if "$(ProgramFiles)\Microsoft Visual Studio 10.0\VSTSDB\Extensions\$(TargetName)$(TargetExt)"

     

    When I load one of our DBPro projects, our custom rules do not appear in the Code Analysis tab. However, when I do a Rebuild on our DBPro project, I get a single error for each of our code analysis rules. The error looks as follows:

     

    Error 12 Type FirstSolarCodeAnalysisRules.CharAndVarcharTypes, FirstSolarCodeAnalysisRules, Version=1.0.0.0, Culture=neutral, PublicKeyToken=928e40df0e260ac9 is not a valid extension type.


    Am I correct that these errors are preventing our rules from loading? And what does this error mean? We were not getting this error before we converted from VS 2008.

    Thanks.

     

    Wednesday, August 25, 2010 7:21 PM

Answers

  • Hi Randy, I mean the assemblies referenced by the assembly under references. Make sure they are of version 10.0 (VS2010). If you are sure of that, make sure the assembly is placed in the right folder (Should be as the loading process had already taken place). For the next steps I would enable fusion log in order to see if the assembly loading.

    But I guess you are just missing some decorations on your assembly which are now required.

    -Jens


    Jens K. Suessmeyer http://blogs.msdn.com/Jenss
    • Proposed as answer by Figo Fei Wednesday, September 1, 2010 3:43 AM
    • Marked as answer by Figo Fei Thursday, September 2, 2010 6:28 AM
    Wednesday, August 25, 2010 9:40 PM
    Moderator
  • Hi Randy

    Since VS2010 you're using, please follow the instructions at this Walkthrough to create custom rules: http://msdn.microsoft.com/en-us/library/dd172127.aspx

    Thanks.


    Figo Fei
    MSDN Subscriber Support in Forum
    If you have any feedback on our support, please contact msdnmg@microsoft.com 


    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    • Proposed as answer by Figo Fei Wednesday, September 1, 2010 3:43 AM
    • Marked as answer by Figo Fei Thursday, September 2, 2010 6:28 AM
    Thursday, August 26, 2010 5:17 AM

All replies

  • Did you update the assembly references to the new assemblies ? You will have to implement the right interface in order to make it load properly.

    -Jens


    Jens K. Suessmeyer http://blogs.msdn.com/Jenss
    Wednesday, August 25, 2010 8:56 PM
    Moderator
  • Jens,

    I'm sorry, do you mean the assembly references in our custom code analysis rules project? If so, what new assemblies are you referring to?

    Randy

    Wednesday, August 25, 2010 9:15 PM
  • Hi Randy, I mean the assemblies referenced by the assembly under references. Make sure they are of version 10.0 (VS2010). If you are sure of that, make sure the assembly is placed in the right folder (Should be as the loading process had already taken place). For the next steps I would enable fusion log in order to see if the assembly loading.

    But I guess you are just missing some decorations on your assembly which are now required.

    -Jens


    Jens K. Suessmeyer http://blogs.msdn.com/Jenss
    • Proposed as answer by Figo Fei Wednesday, September 1, 2010 3:43 AM
    • Marked as answer by Figo Fei Thursday, September 2, 2010 6:28 AM
    Wednesday, August 25, 2010 9:40 PM
    Moderator
  • Hi Randy

    Since VS2010 you're using, please follow the instructions at this Walkthrough to create custom rules: http://msdn.microsoft.com/en-us/library/dd172127.aspx

    Thanks.


    Figo Fei
    MSDN Subscriber Support in Forum
    If you have any feedback on our support, please contact msdnmg@microsoft.com 


    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    • Proposed as answer by Figo Fei Wednesday, September 1, 2010 3:43 AM
    • Marked as answer by Figo Fei Thursday, September 2, 2010 6:28 AM
    Thursday, August 26, 2010 5:17 AM