Table of Cool .NET Tools

Here are some cool .NET tools from MSDN / codeplex, complete with Download and tutorial links. Tool Summary Where to get it Links CLR Profiler Easy way to measure memory performance for managed apps. Download for .NET 2.0, .NET 1.1 Tutorial Perf Console Awesome for analyzing performance issues for apps. This makes perf analysis surprisingly…


Marshal opaque structs as IntPtr instead of Byte[]

If you have an opaque native structure that you want to pass through managed code, consider using IntPtr, not Byte[], in your marshalling signatures.  Opaque means that you don’t care about the contents of the buffer. For example, if in C#, you pinvoke to get an opaque native structure that you then hand to some…


Creative usage

I picked up a sketchpad and a 64-pack of colored pencils at a local hobby store to do so random drawing. I’m no artist and I can’t draw. (My artistic abilities are show-cased on the yellow arrow here). However, I do get a kick out of doing various math equations. The drawing wasn’t working, and…


AppDomain.ProcessExit is not guaranteed to be called

The AppDomain.ProcessExit is not guaranteed to be called. It’s pretty resilient and will deal with common things you may cause from low-trust IL (exceptions, out-of-memory, etc), but there are some things (like rude process shutdown), that an inprocess event can never be resilient against.  Demo: Consider the simple example: using System; class Foo { static…


Mdbg (C# debugger in C#) source sample updated

We’ve just updated the MDbg sample! This is a full source sample for building a managed debugger in C#. It’s available here. (This is the same link as before. If it brings up version 1.0, just try refreshing the page until you get mdbgSample21.EXE). We’re up to version 2.1.0, and it includes: Mdbg + Python…


Thoughts on Vista from a non-computer person

Previously, I installed Vista on my home computer. Here are some comments from my wife. I found her feedback interesting because her usage patterns are closer to the average than mine are. She’s not a developer (would never use Visual Studio or write a .bat file), and her main computer usage is web browsing and Word….


Viewing types with Reflection-Only

It’s natural for a tool to use Reflection-Only loading to load an assembly and view the types in it.  For example, I used this in my pdb2xml tool. However, I missed an important detail that I wanted to warn you about after getting it wrong myself. Consider the following snippet which will print all the…


Hit 300 mark

I hit the 300 post mark. (I hit the 200 mark back in Feb). Some days I feel like I’m still going strong and other days I feel like I’m running out of ideas. It’s still fascinating to see which posts get a lot of interest and which don’t. It’s usually the opposite of what…


LCG + Debuggability, and your feedback

I mentioned earlier that you can debug Reflection.Emit code. Unfortunately, Ref.Emit code can’t be unloaded unless you unload the entire appdomain. I wanted to lay out the current landscape, and then get feedback about possible solutions. In Whidbey, we added Light Weight CodeGen (LCG), which are dynamically generated methods that can be garbage collected. This…


Rename Mdbg forum to "Building Development and Diagnostic Tools for .Net"

We’ve renamed the ICorDebug / Mdbg forum to “Building Development and Diagnostic Tools for .Net”, which effectively is expanding the scope. Jon Langdon posted the announcement here. This still includes ICorDebug and Mdbg questions, but also explicitly includes profiling (ICorProf*), Metadata APIs, and other .NET tool APIs. The motivation is that ICorDebug / Mdbg are…