MSB4062: The "ValidateNTTargetVersion" task could not be loaded from the assembly E:\Program Files\Windows Kits\10\build\10.0.25272.0\bin\Microsoft.DriverKit.Build.Tasks.17.0.dll.

Yi Yi1 Hai 0 Reputation points
2023-04-28T03:07:49.45+00:00

show "Build Failed" message as follow:

C:\QcSensorHub\Root\WP\src\qcdk\Versions\latest\BuildEnv\QC_SetupBuildEnv.cmd & E:\BuildEnv\SetupBuildEnv.cmd &

\Program Files\Windows Kits\10\ & msbuild C:\QcSensorHub\Root\WP\src\sensors\sensors.wp63.sln /p:QCPlatform=8380

/p:platform=ARM64 /p:configuration=Release /p:BuildInParallel=false /fl1

/flp1:verbosity=diagnostic;logfile=C:\QcSensorHub\Root\WP\src\sensors\build.log /fl2

/flp2:warningsonly;logfile=C:\QcSensorHub\Root\WP\src\sensors\build.wrn /fl3

/flp3:errorsonly;logfile=C:\QcSensorHub\Root\WP\src\sensors\build.err

/p:_QCDK_ROOT_PATH=C:\QcSensorHub\Root\WP\src\qcdk\Versions\latest & exit -PassThru

VERBOSE: Error code for the msbuild: 1

VERBOSE: <FAIL>: MSBuild Failed!! Please check the C:\QcSensorHub\Root\WP\src\sensors\build.err for more information

VERBOSE: Dismounting C:\QcSensorHub\WindowsKits\WDK\25272.25272\EWDK_rs_prerelease_25272_221216-1237.iso

VERBOSE: DisMount-DiskImage -ImagePath

C:\QcSensorHub\WindowsKits\WDK\25272.25272\EWDK_rs_prerelease_25272_221216-1237.iso

[FAIL]: Build Failed!! Please check the C:\QcSensorHub\Root\WP\src\sensors\build.err for more information

E:\Program Files\Windows Kits\10\build\10.0.25272.0\WindowsDriver.common.targets(314,5): error MSB4062: The "ValidateNTTargetVersion" task could not be loaded from the assembly E:\Program Files\Windows Kits\10\build\10.0.25272.0\bin\Microsoft.DriverKit.Build.Tasks.17.0.dll. Could not load file or assembly 'Microsoft.DriverKit.Build.Tasks, Version=10.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. Strong name validation failed. (Exception from HRESULT: 0x8013141A) Confirm that the <UsingTask> declaration is correct, that the assembly and all its dependencies are available, and that the task contains a public class that implements Microsoft.Build.Framework.ITask. [C:\QcSensorHub\Root\WP\src\sensors\qcSensors\qcSensors.wp63.vcxproj]

Exiting script

[Environment]

VS2022 committy

WDK: EWDK_rs_prerelease_25272_221216-1237

Visual Studio
Visual Studio
A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.
5,403 questions
Windows 11
Windows 11
A Microsoft operating system designed for productivity, creativity, and ease of use.
10,657 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Dou Xu-MSFT 170 Reputation points Microsoft Vendor
    2023-04-28T08:59:53.28+00:00

    Hello @Yi Yi1 Hai ,

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

    MSB4062 says to resolve the MSB4062 error, ensure that the task expresses a dependency on the runtime environment it requires in the task's UsingTask element.

    Could you check if Microsoft.DriverKit.Build.Tasks.17.0.dll exist in you folder E:\Program Files\Windows Kits\10\build\10.0.25272.0\bin\Microsoft.DriverKit.Build.Tasks.17.0.dll ?

    If not exists, you have to install correct Windows Driver Kit [ WDK ],please refer to this document

    Feel free to contact us.

    Sincerely,

    Douxu


    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.


  2. Limitless Technology 44,501 Reputation points
    2023-04-28T15:00:36.99+00:00

    Hi,

    I'd be happy to help you out with your question. Sorry for the inconvenience caused.

    To help you resolve this issue, here are some steps you can try:

    Check that the "Microsoft.DriverKit.Build.Tasks" assembly and all its dependencies are available in the specified location: "E:\Program Files\Windows Kits\10\build\10.0.25272.0\bin". If any of the files are missing, try repairing or reinstalling the Windows Driver Kit (WDK) to ensure that all the required files are present.

    Verify that the version number and the public key token of the "Microsoft.DriverKit.Build.Tasks" assembly specified in the error message match the actual version and public key token of the assembly in the specified location.

    Verify that the <UsingTask> declaration in the "qcSensors.wp63.vcxproj" project file is correct and that it matches the actual location and name of the "Microsoft.DriverKit.Build.Tasks" assembly.

    If you have recently installed any updates or made any changes to your system, try rolling back those changes and then rebuilding the project.

    You can also try running the build process in verbose mode (/v:d) to get more detailed information about the error and its source.

    If you have any other questions or need assistance with anything, please don't hesitate to let me know. I'm here to help.

    If the reply was helpful, please don’t forget to upvote or accept as answer, thank you.

    0 comments No comments

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.