Error when building Windows driver (Msbuild) from Jenkins to ssh

Asked 2 months ago, Updated 2 months ago, 3 views

It's my first time asking a question, so I'm sorry if there's something wrong with the manners.
The questions are as per the title and are detailed below.
I would appreciate it if you could let me know some small information and what I can try.

Previous Information

  • Linux servers:installing Jenkins
  • Windows 10 terminals:use as build server

What do you want to do

I want to run a batch file from Jenkins to build a Windows driver in Msbuild using the bash ssh command on the build server, and I want the build to succeed.

What's troubling you

If you run it, the following error will occur and the build will fail, so please tell me the solution.

Error Contents

C:\Program Files (x86)\Windows Kits\10\build\WindowsDriver.common.targets(615,5): error MSB4061: "DPVerifierTask" task could not be converted from "C:\hogehoge\Microsoft.DriverKit.Build.Tasks.PackageVerifier.0.l" instance.
        C:\Program Files (x86)\Windows Kits\10\build\WindowsDriver.common.target(615,5):error MSB4061:System.NullReferenceException:Object reference is not configured on the object instance.
        C:\Program Files (x86)\Windows Kits\10\build\WindowsDriver.common.target(615,5): error MSB4061: Location Microsoft.DriverKit.Build.Tasks.DriverPackageVerifier.DPVerifierTask..ctor()
        C:\Program Files (x86)\Windows Kits\10\build\WindowsDriver.common.target(615,5): error MSB4060: "DPVerifierTask" task declared, incorrectly used, or failed during creation.Check the spelling of the task name and assembly name.
    Target "InfVerif" build in project "hogehoge.vcxproj" ended -- failed.

Run Commands

  • Shell (Jenkins)

     ssh-q-o UserKnownHostsFile=/dev/null-o StrictHostKeyChecking=no [email protected]/c/hogehoge/build.bat
    
  • Batch files (build servers)

    msbuild hogehoge.sln/t:Rebuild/p:Configuration=Release;Platform=x64
    

Shell (Jenkins)

 ssh-q-o UserKnownHostsFile=/dev/null-o StrictHostKeyChecking=no [email protected]/c/hogehoge/build.bat

Batch Files (Build Server)

msbuild hogehoge.sln/t:Rebuild/p:Configuration=Release;Platform=x64

What you did

  • Connecting to the build server on a remote desktop and manually performing a batch succeeds
  • If you run a batch file from git bash to ssh on a local Windows 10 terminal, you get the same error as Jenkins

windows jenkins build visual-c++

2022-09-30 11:29

1 Answers

MSBuild comes with OS, Visual Studio and multiple installations.Which one are you running? More specifically, do the settings for the environment variables that contain PATH match when running each MSBuild?

For example, in the questionnaire,

  • Connecting to the build server on a remote desktop and manually performing a batch succeeds

However, do you run it from an environment where environment variables such as Developer Command Prompt are specifically set?


2022-09-30 11:29

If you have any answers or tips


© 2022 OneMinuteCode. All rights reserved.