<p>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.</p>

<p>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?</p>

<p>Barring that, is there some other way I can do this?</p>

<p>Specifically, what I want to do is to tack on the <em>Application Name</em> parameter, so that our application is more easily identified on the server when looking at connections.</p>

<hr>

<p><strong>Edit</strong>: 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.</p>

<p>Is there some definite guide to how to do this successfully?</p>

[{'answer_id': 61274, 'author': 'aku', 'author_id': 1196, 'author_profile': 'https://Stackoverflow.com/users/1196', 'pm_score': 3, 'selected': False, 'text': '<p>You can <a href="http://www.wintellect.com/cs/blogs/jrobbins/archive/2008/01/17/additional-net-framework-source-code-debugging-tricks.aspx" rel="nofollow noreferrer">download .NET source code</a> and set break point right in .NET FW source code.</p>\n\n<p>You can use <a href="http://www.codeplex.com/NetMassDownloader" rel="nofollow noreferrer">NetMassDownloader</a> to grab .NET sources quickly.</p>\n'}, {'answer_id': 61275, 'author': 'Espo', 'author_id': 2257, 'author_profile': 'https://Stackoverflow.com/users/2257', 'pm_score': 2, 'selected': False, 'text': '<p>According to this article you can download the source code for the .NET framework and then debug it using visual studio:</p>\n\n<p><a href="http://weblogs.asp.net/scottgu/archive/2007/10/03/releasing-the-source-code-for-the-net-framework-libraries.aspx" rel="nofollow noreferrer">http://weblogs.asp.net/scottgu/archive/2007/10/03/releasing-the-source-code</a></p>\n'}, {'answer_id': 61277, 'author': 'Lars Truijens', 'author_id': 1242, 'author_profile': 'https://Stackoverflow.com/users/1242', 'pm_score': 3, 'selected': True, 'text': '<p>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.</p>\n\n<p><strong>edit</strong></p>\n\n<p><a href="http://blogs.msdn.com/sburke/archive/2008/01/16/configuring-visual-studio-to-debug-net-framework-source-code.aspx" rel="nofollow noreferrer">This</a> 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.</p>\n'}, {'answer_id': 61285, 'author': 'aku', 'author_id': 1196, 'author_profile': 'https://Stackoverflow.com/users/1196', 'pm_score': 2, 'selected': False, 'text': '<p>I almost forgot to mention <a href="http://www.codeplex.com/deblector" rel="nofollow noreferrer">Deblector</a> - it\'s a Reflector plugin, that allows you to debug almost any .net app without source codes :)</p>\n'}, {'answer_id': 61682, 'author': 'Steve Steiner', 'author_id': 3892, 'author_profile': 'https://Stackoverflow.com/users/3892', 'pm_score': 2, 'selected': False, 'text': '<p>While source debugging is defintely better, you don\'t need pdbs or source for the VS debugger to set a bp on the function you want. </p>\n\n<p>Make sure you go to Tools/Options/Debugger and turn off the option called "Just My Code".  Since the framework is not \'your code\' the debugger unhelpfully prevents you from setting breakpoints there.</p>\n\n<p>Next you need the full name of the method as it appears in the metadata.  This includes any namespaces it is nested in.  I\'d recommend ILDasm or Reflector if you need to find the name.  </p>\n\n<p>On the breakpoints window in the upper left corner is a "new bp" menu button. One of the choices is to set a bp on function name.  When the dialog comes up uncheck having intellisense check the name since you don\'t have a project.  I hope that helps.</p>\n'}, {'answer_id': 61700, 'author': 'aku', 'author_id': 1196, 'author_profile': 'https://Stackoverflow.com/users/1196', 'pm_score': 0, 'selected': False, 'text': '<p>OK, if you want definitive guide, here it is:</p>\n\n<p><a href="http://blogs.msdn.com/sburke/archive/2008/01/16/configuring-visual-studio-to-debug-net-framework-source-code.aspx" rel="nofollow noreferrer">Configuring Visual Studio to Debug .NET Framework Source Code</a></p>\n\n<p>If you want some help, go ahead and tell use which steps did you perform?</p>\n'}]
['https://Stackoverflow.com/questions/61272', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/267/']