Silverlight toolkit: An unknown error occurred running Code Analysis. Please contact Microsoft Product Support Services.

8 בינואר 2009

Hi,


I download the Silverlight Toolkit include source code from codeplex. I Open Silverlight.Controls.sln and try to compile it.


I got error saying: "An unknown error occurred running Code Analysis. Please contact Microsoft Product Support Services."


I'm using VS Team System 2008 SP1 with .NET 3.5 SP1.


In order to solve this error I need to go for each Silverlight Project and remove the "Enable Code Analysis on Build" check box. Very irritating don't you think??!!!!



Well I found better solution:


I download the latest FxCop version (1.36) from here and install it on the directory VS 2008 use the FxCop.


On my machine the location was under: C:\Program Files\Microsoft Visual Studio 9.0\Team Tools\Static Analysis Tools\FxCop


This solve my problem without changing each project "Enable Code Analysis on Build" checkbox.


 I Hope it will help you also Bye Rotem.

Add comment
facebook linkedin twitter email

Leave a Reply

Your email address will not be published.

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

*

7 comments

  1. Justin-Josef Angel 9 בינואר 2009 ב 7:51

    Hi Rotem,

    Thanks for reporting this.

    We'll make sure to scrub the solution before the next source code drop.

    תודה,
    — Justin

    Reply
  2. David M. Kean10 בינואר 2009 ב 8:58

    It's very likely caused by the same issue that caused this: http://davesbox.com/archive/2008/12/26/code-analysis-failing-with-invalid-settings-passed-to-codeanalysis-task.aspx.

    Reinstall the service pack and see if that works.

    FxCop 1.36 has exactly the same version as VS SP1, expect with less rules.

    Reply
  3. Alex Goloubev18 בפברואר 2009 ב 20:20

    Saved my day!

    Reply
  4. Leo Swiontek2 בספטמבר 2009 ב 0:39

    Rotem, I get the same error message but its because I had FxCop 1.36 installed for VS Professional before we went to VSTS 2008 Developer Edition. I went to MSDN forums, and one individual had exactly my setup and did the uninstall of FxCop 1.36, reinstalled VSTS 2008 SP1, etc. I did all that but I cannot get rid of this problem. My last hope is to reinstall VSTS 2008 Developer edition. Any other ideas? I attached the actual error below.

    Thanks man!!!

    Leo Swiontek
    Software Engineer (USAFA)

    C:\Program Files\Microsoft Visual Studio 9.0\VC>"C:\Program Files\Microsoft Visual Studio 9.0\Team Tools\Static Analysis Tools\FxCop\"FxCopCmd.exe /outputCulture:1033 /out:"..\Build\WEdge.BusinessServices.dll.CodeAnalysisLog.xml" /file:"..\Build\WEdge.BusinessServices.dll" /dict
    ionary:"..\WEdgeCodeAnalysisDictionary.xml" /directory:"C:\Dev\TriskaRelease\Build" /directory:"C:\Program Files\Reference Assemblies\Microsoft\Framework\v3.0" /directory:"..\SupportFiles" /directory:"c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727" /rule:"C:\Program Files\Microsof
    t Visual Studio 9.0\Team Tools\Static Analysis Tools\FxCop\Rules" /ruleid:-Microsoft.Design#CA2210 /ruleid:-Microsoft.Design#CA1005 /ruleid:-Microsoft.Design#CA1020 /ruleid:-Microsoft.Design#CA1021 /ruleid:-Microsoft.Design#CA1010 /ruleid:-Microsoft.Design#CA1031 /ruleid:-Microso
    ft.Design#CA1047 /ruleid:-Microsoft.Design#CA1000 /ruleid:-Microsoft.Design#CA1048 /ruleid:-Microsoft.Design#CA1002 /ruleid:-Microsoft.Design#CA1061 /ruleid:-Microsoft.Design#CA1006 /ruleid:-Microsoft.Design#CA1065 /ruleid:-Microsoft.Design#CA1064 /ruleid:-Microsoft.Design#CA1004
    /ruleid:-Microsoft.Design#CA1035 /ruleid:-Microsoft.Design#CA1063 /ruleid:-Microsoft.Design#CA1033 /ruleid:-Microsoft.Design#CA1016 /ruleid:-Microsoft.Design#CA1060 /ruleid:-Microsoft.Design#CA1013 /ruleid:-Microsoft.Design#CA1001 /ruleid:-Microsoft.Design#CA1049 /ruleid:-Micros
    oft.Design#CA1003 /ruleid:-Microsoft.Design#CA1007 /ruleid:-Microsoft.Design#CA1024 /ruleid:-Microsoft.Globalization#CA1302 /ruleid:-Microsoft.Globalization#CA1308 /ruleid:-Microsoft.Interoperability#CA1407 /ruleid:-Microsoft.Interoperability#CA1410 /ruleid:-Microsoft.Interoperab
    ility#CA1411 /ruleid:-Microsoft.Interoperability#CA1409 /ruleid:-Microsoft.Interoperability#CA1415 /ruleid:-Microsoft.Interoperability#CA1414 /ruleid:-Microsoft.Interoperability#CA1412 /ruleid:-Microsoft.Interoperability#CA1400 /ruleid:-Microsoft.Naming#CA1717 /ruleid:-Microsoft.
    Naming#CA1725 /ruleid:-Microsoft.Naming#CA1726 /ruleid:-Microsoft.Reliability#CA2003 /ruleid:-Microsoft.Usage#CA2243 /ruleid:-Microsoft.Usage#CA1816 /ruleid:-Microsoft.Usage#CA2222 /ruleid:-Microsoft.Usage#CA2212 /ruleid:-Microsoft.Usage#CA2219 /ruleid:-Microsoft.Usage#CA2201 /ru
    leid:-Microsoft.Usage#CA2238 /ruleid:-Microsoft.Usage#CA2232 /ruleid:-Microsoft.Usage#CA2223 /ruleid:-Microsoft.Usage#CA2226 /ruleid:-Microsoft.Usage#CA2231 /ruleid:-Microsoft.Usage#CA2239 /ruleid:-Microsoft.Usage#CA2200 /ruleid:-Microsoft.Usage#CA2242 /ruleid:-Microsoft.Usage#CA
    2205 /searchgac /ignoreinvalidtargets /forceoutput /successfile /ignoregeneratedcode /saveMessagesToReport:Active /targetframeworkversion:v3.5 /timeout:120 /verbose
    Microsoft (R) FxCop Command-Line Tool, Version 1.36 (9.0.30729.1)
    Copyright (C) 2007 Microsoft Corporation. All rights reserved.

    * Error(s) occurred during FxCop initialization:
    * An exception was raised attempting to load engine 'c:\program files\microsoft visual studio 9.0\team tools\static analysis tools\fxcop\Engines\IntrospectionAnalysisEngine.dll'.

    Loaded DesignRules.dll…
    Loaded GlobalizationRules.dll…
    Loaded InteroperabilityRules.dll…
    Loaded MaintainabilityRules.dll…
    Loaded MobilityRules.dll…
    Loaded NamingRules.dll…
    Loaded PerformanceRules.dll…
    Loaded PortabilityRules.dll…
    Loaded ReliabilityRules.dll…
    Loaded SecurityRules.dll…
    Loaded UsageRules.dll…
    Loaded WEdge.CodeAnalysis.CustomRules.dll…
    * Could not load file: '..\Build\WEdge.BusinessServices.dll'.
    System.TypeLoadException: Could not load type 'Microsoft.FxCop.FrameworkCompatibility.Framework' from assembly 'FxCopSdk, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'.
    at Microsoft.FxCop.Common.ProjectOptions.IsRecognizedTargetFrameworkVersion(Version version)
    at Microsoft.FxCop.Common.ProjectOptions.set_TargetFrameworkVersion(Version value)
    at Microsoft.FxCop.Command.CommandLineHelpers.ProcessTargetFrameworkVersionArgument(String value)
    at Microsoft.FxCop.Command.FxCopCommand.Main(String[] args)

    C:\Program Files\Microsoft Visual Studio 9.0\VC>msbuild.exe "C:\Dev\TriskaRelease\Wedge.Framework\WEdge.Framework.vbproj /t:rebuild /p:RunCodeAnalysis=true
    Microsoft (R) Build Engine Version 3.5.30729.1
    [Microsoft .NET Framework, Version 2.0.50727.3082]
    Copyright (C) Microsoft Corporation 2007. All rights reserved.

    MSBUILD : error MSB1009: Project file does not exist.
    Switch: C:\Dev\TriskaRelease\Wedge.Framework\WEdge.Framework.vbproj /t:rebuild /p:RunCodeAnalysis=true

    C:\Program Files\Microsoft Visual Studio 9.0\VC>msbuild.exe "C:\Dev\TriskaRelease\Wedge.Framework\WEdge.Framework.vbproj" /t:rebuild /p:RunCodeAnalysis=true
    Microsoft (R) Build Engine Version 3.5.30729.1
    [Microsoft .NET Framework, Version 2.0.50727.3082]
    Copyright (C) Microsoft Corporation 2007. All rights reserved.

    Build started 9/1/2009 2:55:40 PM.
    Project "C:\Dev\TriskaRelease\Wedge.Framework\WEdge.Framework.vbproj" on node 0 (rebuild target(s)).
    Project "C:\Dev\TriskaRelease\Wedge.Framework\WEdge.Framework.vbproj" (1) is building "C:\Dev\TriskaRelease\Wedge.Framework\WEdge.Framework.Communications\WEdge.Framework.Communications.CustomChannel\WEdge.Framework.Communications.CustomChannel.csproj" (2) on node 0 (Clean targe
    t(s)).
    Project "C:\Dev\TriskaRelease\Wedge.Framework\WEdge.Framework.Communications\WEdge.Framework.Communications.CustomChannel\WEdge.Framework.Communications.CustomChannel.csproj" (2) is building "C:\Dev\TriskaRelease\Wedge.Framework\WEdge.Framework.Communications\WEdge.Framework.Com
    munications.MessageInspectors\WEdge.Framework.Communications.MessageInspectors.csproj" (3) on node 0 (Clean target(s)).
    Deleting file "C:\Dev\TriskaRelease\Build\WEdge.Framework.Communications.MessageInspectors.dll".
    Deleting file "C:\Dev\TriskaRelease\Build\WEdge.Framework.Communications.MessageInspectors.pdb".
    Deleting file "C:\Dev\TriskaRelease\Wedge.Framework\WEdge.Framework.Communications\WEdge.Framework.Communications.MessageInspectors\obj\Debug\WEdge.Framework.Communications.MessageInspectors.dll".
    Deleting file "C:\Dev\TriskaRelease\Wedge.Framework\WEdge.Framework.Communications\WEdge.Framework.Communications.MessageInspectors\obj\Debug\WEdge.Framework.Communications.MessageInspectors.pdb".
    EntityClean:
    Successfully cleaned the output for 0 EDMX files.
    Done Building Project "C:\Dev\TriskaRelease\Wedge.Framework\WEdge.Framework.Communications\WEdge.Framework.Communications.MessageInspectors\WEdge.Framework.Communications.MessageInspectors.csproj" (Clean target(s)).

    CoreClean:
    Deleting file "C:\Dev\TriskaRelease\Build\WEdge.Framework.Communications.CustomChannel.dll".
    Deleting file "C:\Dev\TriskaRelease\Build\WEdge.Framework.Communications.CustomChannel.pdb".
    Deleting file "C:\Dev\TriskaRelease\Wedge.Framework\WEdge.Framework.Communications\WEdge.Framework.Communications.CustomChannel\obj\Debug\ResolveAssemblyReference.cache".
    Deleting file "C:\Dev\TriskaRelease\Wedge.Framework\WEdge.Framework.Communications\WEdge.Framework.Communications.CustomChannel\obj\Debug\WEdge.Framework.Communications.CustomChannel.dll".
    Deleting file "C:\Dev\TriskaRelease\Wedge.Framework\WEdge.Framework.Communications\WEdge.Framework.Communications.CustomChannel\obj\Debug\WEdge.Framework.Communications.CustomChannel.pdb".
    EntityClean:
    Successfully cleaned the output for 0 EDMX files.
    Done Building Project "C:\Dev\TriskaRelease\Wedge.Framework\WEdge.Framework.Communications\WEdge.Framework.Communications.CustomChannel\WEdge.Framework.Communications.CustomChannel.csproj" (Clean target(s)).

    CoreClean:
    Deleting file "C:\Dev\TriskaRelease\Build\WEdgeMessage.resx".
    Deleting file "C:\Dev\TriskaRelease\Build\WEdgeMessage.Designer.vb".
    Deleting file "C:\Dev\TriskaRelease\Build\WEdge.Framework.dll.config".
    Deleting file "C:\Dev\TriskaRelease\Build\WEdge.Framework.dll".
    Deleting file "C:\Dev\TriskaRelease\Build\WEdge.Framework.pdb".
    Deleting file "C:\Dev\TriskaRelease\Build\WEdge.Framework.xml".
    Deleting file "C:\Dev\TriskaRelease\Wedge.Framework\obj\Debug\ResolveAssemblyReference.cache".
    Deleting file "C:\Dev\TriskaRelease\Wedge.Framework\obj\Debug\WEdge.Framework.vbproj.ResolveComReference.cache".
    Deleting file "C:\Dev\TriskaRelease\Wedge.Framework\obj\Debug\Resources.resources".
    Deleting file "C:\Dev\TriskaRelease\Wedge.Framework\obj\Debug\WEdgeMessage.resources".
    Deleting file "C:\Dev\TriskaRelease\Wedge.Framework\obj\Debug\WEdge.Framework.vbproj.GenerateResource.Cache".
    Deleting file "C:\Dev\TriskaRelease\Wedge.Framework\obj\Debug\WEdge.Framework.dll".
    Deleting file "C:\Dev\TriskaRelease\Wedge.Framework\obj\Debug\WEdge.Framework.xml".
    Deleting file "C:\Dev\TriskaRelease\Wedge.Framework\obj\Debug\WEdge.Framework.pdb".
    EntityClean:
    Successfully cleaned the output for 0 EDMX files.
    EntityDeploy:
    Processing 0 EDMX files.
    Finished processing 0 EDMX files.
    Project "C:\Dev\TriskaRelease\Wedge.Framework\WEdge.Framework.vbproj" (1) is building "C:\Dev\TriskaRelease\Wedge.Framework\WEdge.Framework.Communications\WEdge.Framework.Communications.CustomChannel\WEdge.Framework.Communications.CustomChannel.csproj" (2:2) on node 0 (default t
    argets).
    Processing 0 EDMX files.
    Finished processing 0 EDMX files.
    Project "C:\Dev\TriskaRelease\Wedge.Framework\WEdge.Framework.Communications\WEdge.Framework.Communications.CustomChannel\WEdge.Framework.Communications.CustomChannel.csproj" (2:2) is building "C:\Dev\TriskaRelease\Wedge.Framework\WEdge.Framework.Communications\WEdge.Framework.C
    ommunications.MessageInspectors\WEdge.Framework.Communications.MessageInspectors.csproj" (3:2) on node 0 (default targets).
    Processing 0 EDMX files.
    Finished processing 0 EDMX files.
    CopyFilesToOutputDirectory:
    Copying file from "obj\Debug\WEdge.Framework.Communications.MessageInspectors.dll" to "..\..\..\Build\WEdge.Framework.Communications.MessageInspectors.dll".
    WEdge.Framework.Communications.MessageInspectors -> C:\Dev\TriskaRelease\Build\WEdge.Framework.Communications.MessageInspectors.dll
    Copying file from "obj\Debug\WEdge.Framework.Communications.MessageInspectors.pdb" to "..\..\..\Build\WEdge.Framework.Communications.MessageInspectors.pdb".
    RunCodeAnalysis:
    Running Code Analysis…
    * Error(s) occurred during FxCop initialization:
    * An exception was raised attempting to load engine 'c:\program files\microsoft visual studio 9.0\team tools\static analysis tools\fxcop\Engines\IntrospectionAnalysisEngine.dll'.

    No engine was able to load target WEdge.Framework.Communications.MessageInspectors.dll.
    System.TypeLoadException: Could not load type 'Microsoft.FxCop.FrameworkCompatibility.Framework' from assembly 'FxCopSdk, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'.
    at Microsoft.FxCop.Common.ProjectOptions.IsRecognizedTargetFrameworkVersion(Version version)
    at Microsoft.FxCop.Common.ProjectOptions.set_TargetFrameworkVersion(Version value)
    at Microsoft.FxCop.Command.CommandLineHelpers.ProcessTargetFrameworkVersionArgument(String value)
    at Microsoft.FxCop.Command.FxCopCommand.Main(String[] args)
    MSBUILD : error : An unknown error occurred running Code Analysis. Please contact Microsoft Product Support Services.
    Code Analysis Complete — 1 error(s), 0 warning(s)
    Done Building Project "C:\Dev\TriskaRelease\Wedge.Framework\WEdge.Framework.Communications\WEdge.Framework.Communications.MessageInspectors\WEdge.Framework.Communications.MessageInspectors.csproj" (default targets) — FAILED.

    Done Building Project "C:\Dev\TriskaRelease\Wedge.Framework\WEdge.Framework.Communications\WEdge.Framework.Communications.CustomChannel\WEdge.Framework.Communications.CustomChannel.csproj" (default targets) — FAILED.

    Done Building Project "C:\Dev\TriskaRelease\Wedge.Framework\WEdge.Framework.vbproj" (rebuild target(s)) — FAILED.

    Build FAILED.

    "C:\Dev\TriskaRelease\Wedge.Framework\WEdge.Framework.vbproj" (rebuild target) (1) ->
    "C:\Dev\TriskaRelease\Wedge.Framework\WEdge.Framework.Communications\WEdge.Framework.Communications.CustomChannel\WEdge.Framework.Communications.CustomChannel.csproj" (default target) (2:2) ->
    "C:\Dev\TriskaRelease\Wedge.Framework\WEdge.Framework.Communications\WEdge.Framework.Communications.MessageInspectors\WEdge.Framework.Communications.MessageInspectors.csproj" (default target) (3:2) ->
    (RunCodeAnalysis target) ->
    MSBUILD : error : An unknown error occurred running Code Analysis. Please contact Microsoft Product Support Services.

    Reply
  5. Rotem Bloom2 בספטמבר 2009 ב 13:00

    Leo Hi,
    Try to install the new Fxcop version I think it's FxCop 1.36 Beta 2 maybe this will help you.

    Reply