July 20, 2002

Understanding VS.NET public and private assemblies

As you might have noticed, the Add Reference dialog in Visual Studio displays all the assemblies in the GAC, which brings up the following question: is there a way to have this list display assemblies that aren’t in the GAC? The answer is yes, and the technique couldn’t be easier.Use

Quickly swap assignment operands

It often happens that you need to swap the operands of an assignment. For example, say that you have this set of assignments: p1.FirstName = m_FirstNamep1.LastName = m_LastName and later in your source code you want to add a similar set of assignments, but with reversed operands: m_FirstName = p1.FirstNamem_LastName

Transform a variable into a Property

Thanks to Visual Studio.NET macros, it is quite simple to automate the task of transforming a Public field into a Property with the same name that accesses a private field of the same type.Press Alt-F11 (or invoke the Macro IDE from the Tools|Macros submenu, select one macro module in the

A macro to protect a code section with a Try…Catch block

When you’re working with the Visual Studio .NET code editor, typing a Try keyword plus the Enter key automatically creates the End Try statement. The following simple macro does something more interesting: it lets you select a portion of code and protect it with a Try…Catch…Finally…End Try block with a

Running ILDASM from inside Visual Studio .NET

Nothing beats ILDASM when it’s time to understand what your VB.NET or C# compiler actually emits. In this case you should prepare a desktop shortcut to ILDASM so that you can run it quickly, and then open a Windows Explorer window on the Bin directory of your project, so that