Helllo World,
I want to write and debug kmdf windows driver using visual studio 2022. I can debug my driver using a host and target computer using windbg and kdnet so my network config is ok.
When i try to configure visual studio 2022 i can build and link my driver but i have problem to deploy it. In visual studio in the properties of the project i have a Driver Install - Deploy option tab with several options:
Do not install
HardwareId of the driver
Custom command line
Install/reinstall and verify
Fast reinstall
Can you explain what are these options and tells me what i need to do to deploy my driver and debug it from vs2022.
If I select "do not install" and press F5, my driver compiles/links fine but at the end i have "Could not connect to the remote computer for deployment."
What do i need to check and is there any log to check ?
Rem: I can ping the target from my host, i can rdp the target from my host and windbg can connect and break into the kernel so what is wrong with visual Studio.
I know that OSR recommend to use windbg instead of visual studio but I would like to test it from visual studio.
Is there somewhere a web site which explain how to do this basic operation ?
Thx in advance for your time and help
Best regards
There’s a reason for this: Debugging in VS is error prone, works and does not work seemingly randomly, and there’s no way to figure out what happened or why something doesn’t work. As you’re discovering…
Thx for your answer. The situation is very strange, and I investigated it with IT support:
Windbg works perfectly and use udp protocol for com between host and target (check with WireShark)
In visual studio when I click on F5, the ide makes a tcp connect to the target which does not work. (seen in WireShark) Ping on the other hand is ok.
Windbg use APIPA address range in all cases
I try to use static ip with the nodhcp option but it does not work in vs2022
I try to use dhcp but it does not work neither.
What debugger is under the hood in vs2022 ???? I was assuming that it uses windbg, so why this tcp connect when I try to debug ???
The whole stuff is missing log and info to be able to make a correct diagnostic
Is it possible to know what it is used internally when I press F5 ???
4 days to install/setup/debug this for nothing…
->Will switch to WinDbg tomorrow if nothing new
Info on APIPA: learn microsoft com en-us windows-hardware/drivers debugger setting-up-a-network-debugging-connection
How the debugger obtains an IP address for the target computer
KDNET on the target computer attempts to use Dynamic Host Configuration Protocol (DHCP) to get a routable IP address for the network adapter that's being used for debugging. If KDNET obtains a DHCP-assigned address, then the target computer can be debugged by host computers located anywhere on the network. If KDNET fails to obtain a DHCP-assigned address, it uses Automatic Private IP Addressing (APIPA) to obtain a local link IP address. Local link IP addresses aren't routable, so a host and target can't use a local link IP address to communicate through a router. In that case, network debugging will work if you plug the host and target computers into the same network hub or switch.