I have a third party library that internally constructs and uses the SqlConnection class. I can inherit from the class, but it has a ton of overloads, and so far I have been unable to find the right one. What I’d like is to tack on a parameter to the connection string being used.
Is there a way for me to put a breakpoint in the .NET library core itself? Specifically in the constructors of the SqlConnection class, so that I can look at the stack trace and see where it is actually being constructed?
Barring that, is there some other way I can do this?
Specifically, what I want to do is to tack on the Application Name parameter, so that our application is more easily identified on the server when looking at connections.
Edit: Well, it appears I need more help. I think I’ve enabled everything related to symbol server support, and I’ve noticed that the directory I configured has filled up with directories that contain .pdb files. Still, I can’t get the actual source to the SqlConnection class to become available.
Is there some definite guide to how to do this successfully?
And if you can’t use source level debugging with the .Net framework source code Microsoft supplied, you could try a different debugger. Like mdbg or even windbg.
edit
This explains getting the released parts of .Net framework and how to set breakpoints in great detail. The NetMassDownloader will give you everything (pdb and source) in one download. But not all source code of the .Net framework is available. If your SqlConnection is not you can always use IL debuggers like the ones I mentioned. And don’t forget Lutz’s Reflector to give you a look at the source code anyway.