locked
FxCop run from MSBuild behaves differently on x86 versus x64 German Windows (different outputCulture parameter)

    Question

  • Hi,

    We work in a team having the following development systems:
    German x86/x64 Windows 7 (German Language and Region) with English Visual Studio 2010 (10.0.40219.1 SP1Rel)

    Depending on running on x86 or x64 Windows, the code analysis started from MSBuild behaves differently (e.g. CA1709 errors occur on x64 machines only when building the same sources in both environments).

    On x86 Windows, by default MSBuild runs FxCopCmd.exe /outputCulture:1033 ...
    On x64 Windows instead, by default MSBuild runs FxCopCmd.exe /outputCulture:1031 ...

    It seems that on x64 Windows German language settings are taken into account when running code analysis whereas on x86 Windows code analysis runs language-independent.

    I figured out that the default behavior can be overloaded by adding the following setting in the property group just below the comment <!-- FxCop analyzer targets --> in Microsoft.CodeAnalysis.Targets:

    <CodeAnalysisCulture>en-US</CodeAnalysisCulture>

    So, we've found a workaround to have the same behavior on all machines.

    My question: What code analysis behavior is expected by default, a language dependent or a language independent?

    Thanks!

    Friday, March 09, 2012 3:31 PM

Answers

  • I cannot find any article from MSDN talked the Visual Studio 2010 version CodeAnalysisCulture property, and only a Visual Studio 2008 version: http://blogs.msdn.com/b/codeanalysis/archive/2007/08/12/new-for-visual-studio-2008-spelling-rules.aspx

    And based on this article, I'm afraid that it is language dependent, and you will need to add this node. Maybe your x64 system/VS has some configurations make the Visual Studio 2010 version code analysis tool checked the German language, maybe your VS has installed the German language package.

     

    Mike Zhang[MSFT]
    MSDN Community Support | Feedback to us

    Monday, March 12, 2012 3:16 AM
    Moderator
  • Hi Mike,

    Thank you, your answer helped me.

    I figured out that on German x64 machines the language pack "Microsoft Visual Studio 2010 Tools für Office Laufzeit (x64) Language Pack - DEU" is installed by default which is missing on x86 machines:

    Christian

    Monday, March 12, 2012 11:20 AM

All replies

  • I cannot find any article from MSDN talked the Visual Studio 2010 version CodeAnalysisCulture property, and only a Visual Studio 2008 version: http://blogs.msdn.com/b/codeanalysis/archive/2007/08/12/new-for-visual-studio-2008-spelling-rules.aspx

    And based on this article, I'm afraid that it is language dependent, and you will need to add this node. Maybe your x64 system/VS has some configurations make the Visual Studio 2010 version code analysis tool checked the German language, maybe your VS has installed the German language package.

     

    Mike Zhang[MSFT]
    MSDN Community Support | Feedback to us

    Monday, March 12, 2012 3:16 AM
    Moderator
  • Hi Mike,

    Thank you, your answer helped me.

    I figured out that on German x64 machines the language pack "Microsoft Visual Studio 2010 Tools für Office Laufzeit (x64) Language Pack - DEU" is installed by default which is missing on x86 machines:

    Christian

    Monday, March 12, 2012 11:20 AM
  • You're welcome!

    Have a good day!


    Mike Zhang[MSFT]
    MSDN Community Support | Feedback to us

    Tuesday, March 13, 2012 12:17 PM
    Moderator