I am developing a visual studio package which will take the form of an extension for SSMS (SQL Server Management Studio). I want to open SSMS when I run the project in debug mode. When I press run, SSMS opens normally but as soon as I try to connect to a database Visual Studio throws this exeption:
Managed Debugging Assistant 'PInvokeStackImbalance' has detected a problem in 'C:\Program Files (x86)\Microsoft SQL Server\110\Tools\Binn\ManagementStudio\Ssms.exe'.
Additional information: A call to PInvoke function 'ObjectExplorer!Microsoft.SqlServer.Management.UI.VSIntegration.ObjectExplorer.Service::GetBrowserInfoInterop' has unbalanced the stack. This is likely because the managed PInvoke signature does not match the unmanaged target signature. Check that the calling convention and parameters of the PInvoke signature match the target unmanaged signature.
If I hit 'continue' it will display the same exception a couple more times but eventually it will go away. SSMS runs normally, the item in the Tools menu shows up (photo attached)
But the problem is that break points are not hit on Visual Studio.
I chose SSMS as the startup program from "Start external program" in the Debug section in project properties. By default it has devenv.exe from the VS15 installation folder. Now, I'm thinking that the problem here is that debugging is available only if the devenv.exe is selected as the external program. Am I right? If so, is there any way to enable debugging?