azure-devopsmidl

Azure pipelines unable to locate MIDL compiler


I'm trying to move a Visual Studio project into Azure pipelines. This project uses the MIDL compiler, but when running in the pipeline midl.exe is not found:

(Midl target) -> 
  TRACKER : error TRK0005: Failed to locate: "midl.exe". The system cannot find the file specified.

I cannot find any reference to MIDL in the Azure pipelines documentation, or anything about the Windows SDK more generally, as I assume it would be preinstalled when using one of the Windows VM images

pool:
  vmImage: 'windows-2019'

currently using 'windows-2019' as we need to make some updates to the project's dependencies before I can update it to 'windows-latest'

Is this an issue of just not having it in the PATH when running the pipeline or is it actually not installed in the default VM image? If so how would I view the VM workspace to know what path value to add/how would I go about installing it?


Solution

  • I eventually solved this issue by running the vsdevcmd.bat script in the pipeline to get all the necessary variables set in the environment. I found this link on github to a pipeline script that locates the appropriate version using the vswhere command