MSB4044 - Issue Compiling MSR Driver and Generating MSR.sys File

Boubou Niang 20 Reputation points
2024-02-06T16:16:36.5066667+00:00

Hello everyone, I'm encountering an issue while attempting to compile the MSR driver and create the MSR.sys file following the instructions provided in the WINDOWS_HOWTO.md tutorial from the Intel PCM GitHub repository (https://github.com/intel/pcm/blob/master/doc/WINDOWS_HOWTO.md#compile-the-windows-msr-driver). I have tried both using the cloned project from the GitHub repository cloned (https://github.com/intel/pcm) and the release zip file from the same repository (https://github.com/intel/pcm/releases), but I encountered the problem in both cases. I'm following the tutorial's guidance and using the following command:

MSBuild.exe MSR.vcxproj -property:Configuration=Release -property:Platform=x64

When executing the command, I encounter the following error:

Project "D:\Users\firstname.name\pcm-202401\src\WinMSRDriver\MSR.vcxproj" on node 1 (default targets).
C:\Program Files (x86)\Windows Kits\10\build\10.0.22621.0\WindowsDriver.common.targets(314,5): error MSB4044: The "ValidateNTTargetVersion" task has not been assigned a value for the required "ValidNTTarg
andVersions" parameter. [D:\Users\firstname.name\pcm-202401\src\WinMSRDriver\MSR.vcxproj]
Project generation "D:\Users\firstname.name\\pcm-202401\src\WinMSRDriver\MSR.vcxproj" completed (default targets) -- FAILED.					

"D:\Users\firstname.name\pcm-202401\src\WinMSRDriver\MSR.vcxproj" (default target) (1) ->

After reviewing my MSR.vcxproj file, I discovered that a path referenced within it does not exist.

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
    <DebuggerFlavor>DbgengKernelDebugger</DebuggerFlavor>
    <IncludePath>C:\Program Files (x86)\Windows Kits\10\Include\10.0.14393.0\um;$(IncludePath)</IncludePath>
 </PropertyGroup>


I updated the version from 10.0.14393.0 to 10.0.22621.0 to match the version I have in the MSR.vcxproj file without success. I did not observe anything intriguing in the WindowsDriver.common.target file, a portion of which is displayed below.

 C:\Program Files (x86)\Windows Kits10\build\10.0.22621.0\WindowsDriver.common.targets
  <!-- *******************************************************************************************
        Makes sure lower nt_target versions cant be linked to higher targert version libs.
       ******************************************************************************************* -->
  <Target Name="ValidateNTTargetVersion" BeforeTargets="ValidateDriverProperties">
    <ValidateNTTargetVersion ValidNTTargetVersions   = "$(Valid_NTTARGETVERSIONS)"
	                                         CurrentNTTargetVersion = "$(_NT_TARGET_VERSION)">
	<Output TaskParameter="NTTargetVersionNotValid" PropertyName="UnknownNTTARGETVERSION" />
    </ValidateNTTargetVersion>
  </Target>

Does anyone have any suggestions or ideas to assist me? Thank you in advance for your help.

Windows 10
Windows 10
A Microsoft operating system that runs on personal computers and tablets.
12,077 questions
Visual Studio
Visual Studio
A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.
5,448 questions
0 comments No comments
{count} votes

Accepted answer
  1. Tianyu Sun-MSFT 33,491 Reputation points Microsoft External Staff
    2024-02-07T08:05:14.4266667+00:00

    Hello @Boubou Niang,

    Thank you for taking time to post this issue in Microsoft Q&A forum.

    If you open the MSR.vcxproj file, you may see that the <TargetVersion> property was not set, for Release|x64.

    I’m not sure why this property wasn’t set, it seems that for other configurations, this property was correctly set. So, if you try to compile for Debug|x64 or other configurations, the compiling process should pass.

    The solution should be setting the <TargetVersion> property, for Release|x64. I modified and saved it by opening the MSR.vcxproj file using Visual Studio and setting it to => <TargetVersion>Windows10</TargetVersion>. Maybe directly opening the MSR.vcxproj file with Notepad and setting the TargetVersion property work too, you can have a try.

    Have a nice day.

    Best Regards,

    Tianyu


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.