Friday, May 16, 2008

Troubleshooting VSTO Add-ins

During development By default, if an add-in created with Visual Studio Tools for Office throws an exception, the Office application continues without displaying the exception. Set the debugger to break on all exceptions to see when add-in exceptions are thrown. After deployment VSTO can write all errors that occur during startup to a log file or display each error in a message box. By default, these options are turned off for application-level projects. You can turn the options on by adding and setting environment variables. To display each error in a message box, set the VSTO_SUPPRESSDISPLAYALERTS variable to 0 (zero). You can suppress the messages by setting the variable to 1 (one). To write the errors to a log file, set the VSTO_LOGALERTS variable to 1 (one). Visual Studio Tools for Office creates the log file in the folder that contains the application manifest. The default name is .manifest.log. To stop logging errors, set the variable to 0 (zero).

Thursday, April 17, 2008

Virtual PC and MAC addresses

When you copy a VPC, only copy the VHD images and do no copy and reuse the VMC file. When a VMC is created, VPC generates a MAC address for the virtual ethernet adapter(s), and stores this in the VMC file. If you copy the VMC file, and used networking with your VPC, you will end up with duplicate MAC address within your network.

Monday, January 7, 2008

Connect to the Console using Remote Desktop Connection

Whenever you are using Remote Desktop to manage your server, you will sooner or later run into the problem that the maximum number of connections has been reached (Windows Server 2003 allows 2 RDP connections active). Usually, you'll end up blaming your co-workers for not logging of. Fortunately, RDP allows you to connect directly to the console, instead of using another sessoin. To force RDC to connect to the console start it via the command line (start > run): mstsc /console then select the computer to connect to as normal. Note that connecting to the console session will take over the session from whoever is currently logged in.

Tuesday, December 18, 2007

Copy Source Code as HTML

Another great utility for .NET Developers is Colin Coller's CopySourceAsHtml Add-In. Quote

CopySourceAsHtml is an add-in for Microsoft Visual Studio 2005 that allows you to copy source code, syntax highlighting, and line numbers as HTML. CSAH uses Visual Studio's syntax highlighting and font and color settings automatically. If Visual Studio can highlight it, CSAH can copy it, and your source should look the same in your browser as it does in your editor.

RightHand DataSet Debugger Visualizer

[update]

There is a version available for both Visual Studio 2005 and Visual Studio 2008 with no expiration date. Check out the download section at this url: http://cs.rthand.com/files/folders/righthand_downloads/tags/.net/Visualizer/default.aspx

[/update]

One of the features of Visual Studio 2005 is the use of 'Debugger Visualizers'.

One of the better visualizers for DataSet is 'RightHand.DebugerVisualizer.Dataset.Visualizer'.

This great tool does not only visualize your datasets/tables (including images), but allows you to edit them, call AcceptChanges(), see rowstate & rowerror information and so on. Check the screenshot below to get an idea of its capabilities.

The tool is free, but it has an expiration date set. You should check the forums of Righthand's website to get a version that is not yet expired.

If you can't find a non-expired version, you could always use a IL editor to modify the expiration date (it's right there, if you know where to look)