Copy
C:\Program Files (x86)\Windows Kits\10\build\bin\Microsoft.DriverKit.Build.Tasks.16.0.dll
to
C:\Program Files (x86)\Windows Kits\10\build\bin\Microsoft.DriverKit.Build.Tasks.17.0.dll
will fix this bug
Driver samples give build errors
I have windows 10, vs2019, the latest WDK and SDK.
I can't get the windows driver samples to build. The samples were downloaded today and are dated late March
PLX9x5x gives the following
Severity Code Description Project File Line Suppression State
Error MSB4062 The "ValidateNTTargetVersion" task could not be loaded from the assembly C:\Program Files (x86)\Windows Kits\10\build\bin\Microsoft.DriverKit.Build.Tasks.17.0.dll. Could not load file or assembly 'file:///C:\Program Files (x86)\Windows Kits\10\build\bin\Microsoft.DriverKit.Build.Tasks.17.0.dll' or one of its dependencies. The system cannot find the file specified. 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. plx C:\Program Files (x86)\Windows Kits\10\build\WindowsDriver.common.targets 302
and this
C:\Users\Test-Eng-220411\Desktop\Sample drivers\PLX9x5x\sys\Pci9x5x.vcxproj : warning : Wildcards in project items are not supported in VC projects and can cause unexpected behavior, instability and performance degradation in the Visual Studio IDE. Please refer to https://aka.ms/cpp/projectwildcards for supported options.
C:\Users\Test-Eng-220411\Desktop\Sample drivers\PLX9x5x\test\plx.vcxproj : warning : Wildcards in project items are not supported in VC projects and can cause unexpected behavior, instability and performance degradation in the Visual Studio IDE. Please refer to https://aka.ms/cpp/projectwildcards for supported options.
and this
1>C:\Users\Test-Eng-220411\Desktop\Sample drivers\PLX9x5x\sys\pci9x5x.inx(21-21): error 1284: Class "Sample" is reserved for use by Microsoft.
1>C:\Users\Test-Eng-220411\Desktop\Sample drivers\PLX9x5x\sys\pci9x5x.inx(33-33): error 1285: Cannot specify [ClassInstall32] section for Microsoft-defined class.
the pcidrv sample gives the following
2>C:\Users\Test-Eng-220411\Desktop\Sample drivers\pcidrv\kmdf\genpci.inx(19-19): warning 1324: [Version] section should specify PnpLockdown=1.
2>C:\Users\Test-Eng-220411\Desktop\Sample drivers\pcidrv\kmdf\genpci.inx(21-21): error 1284: Class "Sample" is reserved for use by Microsoft.
2>C:\Users\Test-Eng-220411\Desktop\Sample drivers\pcidrv\kmdf\genpci.inx(34-34): error 1285: Cannot specify [ClassInstall32] section for Microsoft-defined class.
and the same wildcard warnings
4 answers
Sort by: Most helpful
-
chen erich 5 Reputation points
2023-02-21T10:47:23.6933333+00:00 -
Limitless Technology 39,651 Reputation points
2022-05-11T07:13:58.27+00:00 Hi there,
MSB4062 This error is emitted when a task assembly cannot be loaded prior to executing a task.
Error MSB4018 may be caused when running a task in an environment that it was not prepared for, for instance when a task assembly targets 32-bit x86 but is running in a 64-bit MSBuild environment.
To resolve this, ensure that the task expresses a dependency on the runtime environment it requires in the task's UsingTask element.
UsingTask element (MSBuild) https://learn.microsoft.com/en-us/visualstudio/msbuild/usingtask-element-msbuild?view=vs-2022
TraceLogging for kernel-mode drivers and components https://learn.microsoft.com/en-us/windows-hardware/drivers/devtest/tracelogging-for-kernel-mode-drivers-and-components
-------------------------------------------------------------------------------------------------------------------------------------------
--If the reply is helpful, please Upvote and Accept it as an answer–
-
S.Sengupta 18,781 Reputation points MVP
2022-10-02T00:48:48.327+00:00 Uninstall, reinstall Visual Studio.
-
chen erich 5 Reputation points
2023-02-21T08:57:16.2033333+00:00 My scsi mini port driver project can build well in vs2019 but get this error in vs2022.