Device driver does not install on any devices, use primitive driver if this is intended in Visual studio 2019?

9.1k views Asked by At

I upgraded my Visual Studio from 2017 to 2019, and it seems like they have made some fantastic changes to visual studio in the latest version because i did not have this problem in VS 2017, Even compiling simple hello world drivers that you can find anywhere no longer compile and they give the following error:

Device driver does not install on any devices, use primitive driver if this is intended

It seems like it is related the default INF file :

https://github.com/MicrosoftDocs/windows-driver-docs/issues/2067

but the answers there were useless and non of the changes mentioned for the INF file helped, this is my INF file which is the default INF on VS 2019 :

;
; HelloWorld.inf
;

[Version]
Signature="$WINDOWS NT$"
Class=System
ClassGuid={4d36e97d-e325-11ce-bfc1-08002be10318}
Provider=%ManufacturerName%
DriverVer=
CatalogFile=HelloWorld.cat
PnpLockDown=1

[DestinationDirs]
DefaultDestDir = 12


[SourceDisksNames]
1 = %DiskName%,,,""

[SourceDisksFiles]


[Manufacturer]
%ManufacturerName%=Standard,NT$ARCH$

[Standard.NT$ARCH$]


[Strings]
ManufacturerName="<Your manufacturer name>" ;TODO: Replace with your manufacturer name
ClassName=""
DiskName="HelloWorld Source Disk"

How should i change it?

2

There are 2 answers

0
zerocool On BEST ANSWER

to solve that problem just remove the inf file from the visual studio and recompile and then it will work.

1
Mitten.O On

This is caused by the new "Primitive Drivers" concept in Windows 10 1903. The purpose is to explicitly model drivers that aren't actually related to a device. See Microsoft Documentation on Primitive Drivers for details.

Your inf contains none of the sections for which there are instructions for migration, but it has the Manufacturer section, which is not allowed for primitive drivers. Remove it and the validation may succeed.