Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to debug ISAPI using Visual Studio

as title, my friend's environment is Windows 2003 server. He attached the IIS process and set the breaking points at codes supposed to run, but VS doesn't stop at all. The ISAPI is written with VC++.

Is there any setting he need to set up?

Thanks.

like image 264
Ricky Avatar asked Jan 23 '23 04:01

Ricky


2 Answers

This is kind of late, but there is an easier way.

  • Right click your (ISAPI) project, select Properties
  • In the dialog select Configuration Properties->Debug
  • Enter:
    • Command : C:\Windows\System32\inetsrv\w3wp.exe
    • Command Arguments : -debug
  • Now do "Start Debugging(F5)" for you project.

Visual Studio will launch a test instance of IIS and you can debug your DLL, no need to attach to process, etc.

Make sure to stop IIS service beforehand.

like image 129
dpiskyulev Avatar answered Jan 25 '23 17:01

dpiskyulev


Visual studio can debug various types of Code: Native, Script, Managed, Silverlight etc. You need to ensure that when you attach that the Attach To: box contains "Native code".

You also need to be sure you are attaching to the correct instance of w3wp.exe if there is more than one.

like image 39
AnthonyWJones Avatar answered Jan 25 '23 17:01

AnthonyWJones