Visual studio can debug various types of Code: Native, Script, Managed, Silverlight, etc. You need to make sure that when attaching, the Attach To: field contains "Native code".
You also need to make sure that you are connecting to the correct instance of w3wp.exe, if there is more.
source
share