VS2022 driver build fails on the INF file that is excluded from the build
This ticket was forwarded from VS2022 ticket team as they have reproduced and determined that the problem is with WDK. It worked in VS2019 16.11.46 with WDK 10.0.22621.0, now fails in VS2022 17.14.10 with WDK 10.0.26100.0. The reference to the original VS2022 ticket: (https://developercommunity.visualstudio.com/t/VS2022-driver-build-fails-on-the-INF-fil/10949028#T-ND10950135).
Below are the 2 scenarios the cause the faulty behavior by WDK:
[Scenario-1] VS2022 driver build fails on the INF file that is excluded from the build
Steps to reproduce:
- Created a sample NDIS driver project from the template “Filter Driver: NDIS”.
- Added to the project the second *.INF file named TEST.INF.
- Within the properties of the TEST.INF , selected “Excluded From Build”=“Yes”
- Launched the build.
- Observed the build failed with the message: “E:\VSProjects\test_ndislwf1\test_ndislwf1\TEST.INF : error 1000: INF ‘TEST.INF’ could not be found.”
Expected behavior:
The build should succeed, because no other errors.
[Scenario-2] VS2022 corrupts the project file (*.vcxproj) when changing the “Item Type” to “Inf”
Steps to reproduce:
- Create a new sample driver project with an *.INF file (e.g. “Filter Driver: NDIS”)
- Within the FileExplorer clone a single INF file (e.g. from “ndislwf1.inf” to “ndislwf1 - Copy.inf”
- Within the Solution Explorer, right click on the “Driver Files” folder, then expanbd Add submenu , the click “Existing Item”. Select the INF file that was cloned in the previous step.
- Within the Solution Explorer, observe that the file was added. Open up its properties. Navigate to “General”. Observe: “Excluded From Build” is blank, and “Item Type” is “Does not participate in build”.
- Change “Item Type” to “Inf”. Click Apply and OK to close the properties.
- Try to open that file properties again and observe VS 2022 pops up error dialog: “Could not find project item with item type ‘None’ and include value …”.
Expacted behavior:
VS2022 should recognize the INF file by its extension and set “Item Type” to “Inf” upon adding of the INF file. VS2022 should not corrupt the project file when changing “Item Type” of a file.