Skip to main content

 none
Code Analysis is not working for WDK project on Windows container RRS feed

  • Question

  • I got following error when compiling a C++ driver project with Build Tools 2017 in Windows container “windowservercore”.

    Running Code Analysis for C/C++...
    
    c1xx : error C2220: warning treated as error - no 'object' file generated [C:\jenkins\workspace\ABC-DEV\ABC\ABC.vcxproj]
    
    c1xx : fatal error C1250: Unable to load plug-in 'C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\localespc.dll'. [C:\jenkins\workspace\ABC-DEV\ABC\ABC.vcxproj]

    Building it with same build tools and workloads on Win10 does not have this problem.
    localespc.dll is actually present under ‘C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin’ in container.

    How to resolve this error?

    Compile script:

    call "C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Auxiliary\Build\vcvarsall.bat" x64
    
    "C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\Bin\MSBuild.exe"  C:\Work\ABC.sln /p:configuration=Release /p:platform=x64 /t:rebuild

    This error can be resolved by adding the /p:PlatformToolset=v141 to the compile command, but the project cannot be built successfully with the value of PlatformToolset change from “WindowsKernelModeDriver10.0” to “v141”.

    For details of the problem,pls see the below link.
    https://developercommunity.visualstudio.com/content/problem/647444/code-analysis-is-not-working-on-windows-container.html

    Thursday, September 12, 2019 2:09 AM