background preloader

.Net

Facebook Twitter

Debugger.Break inside Windows service crashes service. I have a Windows service that I'd like to debug. The only way I know of to do this is to put a Debugger.Break somewhere in the Windows service. However, when the Debugger.Break is hit, the Windows service stops abruptly. Below you'll find (all coresponding to the same crash of my Windows service):- error event log entry (28-5-2010 9:37:15)- information event log entry (28-5-2010 9:37:19)- another information event log entry (28-5-2010 9:37:26) I'll attach the Windows error reporting file described in the event log entry from 28-5-2010 9:37:26. ------------------------------------------------------------Error event log entry (28-5-2010 9:37:15) ------------------------------------------------------------Information event log entry (28-5-2010 9:37:19) Fault bucket , type 0Event Name: CLR20r3Response: Not availableCab Id: 0 These files may be available here:C:\ProgramData\Microsoft\Windows\WER\ReportQueue\AppCrash_BZ42V4T3JZLUWN5C_1bdf89cf9aee5b3929d34a7512934aa1d4b1ef17_cab_19c69faa.

How to circumvent "Cannot obtain value of local or argument as it is not available at this instruction pointer, possibly because it has been optimized away - zc0000. New commands in SOS for .NET 4.0 Part 1 - If broken it is, fix it you should. My friend and fellow debugger Brian at recently wrote a couple of posts on news with sos for .NET framework 4.0 (in Danish) New SOS Commands in .NET 4 More debugging news in CLR 4 Since Danish, although a beautiful language is probably foreign to most of you I figured I’d write a summary of the new commands in English and add some comments of my own. Loading sos for .NET 4.0 As in 2.0 you will find sos.dll in the framework directory so you can load it in windbg or cdb using the full path .load C:\Windows\Microsoft.NET\Framework\v4.0.30128\sos.dll You can also use the short hand .loadby method but since the name of the core dll has changed in 4.0, you will no longer load it using .loadby sos mscorwks, instead you can now load it using .loadby sos clr SOS now takes advantage of windbg’s DML feature making it easier to debug DML stands for Debugger Markup Language and allows commands to emit hyper links in the command output. 0:042> !

DML is used in many places in sos… in ! 1. WinDbg / SOS Cheat Sheet. First Look at Psscor2 the new WinDBG Debugging Extension for Managed Code | Cory Foy. About two weeks ago Microsoft announced the release of Psscor2 – a managed debugging extension for WinDBG which is a superset of the awesome SOS debugging extension. This is an insanely useful tool when you are trying to debug problems on Production machines where you don’t (and can’t) install Visual Studio, or when you need a deeper understanding of what is going on with your managed code. While there are several articles listing out the commands and a detailed command help view, there isn’t much else. I’m teaching my .NET Debugging class in two weeks for a client in NYC and wanted to include a section on Psscor2.

Since I was going through the commands, I thought it would be fun to post them for the world to see as well. (Note: Don’t leave this blog post without looking at the FindDebugTrue and FindDebugModules commands!) Loading Psscor2 First, download it from the download site above. Once you have it loaded, you can type “! ! The first new command is ! 0:000> ! Total 10 exceptions ! 0:000> ! ! Configuring Visual Studio to Debug .NET Framework Source Code - Shawn Burke's Blog. It's finally here - the launch of the .NET Reference Source project. This post (hopefully!) Contains everything you need to know.

Over the past few weeks, we ran a pilot of this feature and collected lots of great data that helped us work through some issues and understand where people were likely to have problems. First, though, if you have any problems, please make sure you've followed all of the steps exactly as described. If you're still having problems, please check the FAQ/Troubleshooting section at the bottom. Note this functionality is not available on the Express versions of the Visual Studio 2008 products. 1) Install the Visual Studio 2008 QFE. UPDATE: If you get an error installing the Hotfix , try inserting your VS 2008 DVD and then running the Hotfix EXE again. UPDATE (1/18): There were some problems with the QFE link above that have been addressed, sorry for the inconvenience, it's fixed now. 2) Start Visual Studio 2008 and bring up Tools > Options > Debugging > General.

Step Into .NET Framework 4.0 Source Code - Arik Poznanski. In this post I’ll show you how to configure your Visual Studio 2010 to step into the source code of .NET Framework 4.0 Why? Because its cool. Because it helps with debugging. Not only you can see the code but you can step into it. Because unlike with Reflector, you get the code with the original comments and variable names! Step 1: Download Source Go to Download from the line marked with Product Name: .Net , Version: 4 That's a 175MB download. Step 2: Install Source Install “Net_4.msi”, which you have downloaded at the previous step. I’ve installed it into: “D:\RefSrc\” The installed size is approximately 1GB of source and symbols (are you excited yet?) Step 3: Setup Visual Studio 2010 For configuring Visual Studio 2010: 1. 2. 3. 4.

In the Symbol File Locations box, add the downloaded symbols location: “D:\RefSrc\Symbols” Note: To add the Symbols path Click on the folder icon. That’s it, you can now try to F11 (Step Into) .NET source code.