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

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

  • 2012年3月9日 下午 03:31
     
     

    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!

所有回覆

  • 2012年3月12日 上午 03:16
    版主
     
     已答覆

    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

  • 2012年3月12日 上午 11:20
     
     已答覆

    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

  • 2012年3月13日 下午 12:17
    版主
     
     

    You're welcome!

    Have a good day!


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