Monday, November 30, 2009

Windows 2000 and Virtual PC

Surprised to find that Windows Update still works with Windows 2000. Evidently Microsoft "Extended Support" is good through July, 2010. Also surprised to see that Microsoft Virtual PC 2007 "add-ins" support Windows 2000, including mapping drives to the local hard drive.

This means that those who need to test software compatibility with Windows 2000 should create a fully patched virtual hard drive image under Virtual PC sometime prior to July, 2010 when Windows Update goes down for Windows 2000.

Monday, November 16, 2009

dotConnect for PostgreSQL

Don't even think about using PostgreSQL with Visual Studio without purchasing dotConnect.

The alternatives are npgsql, which doesn't integrate with the Visual Studio data designer, and ODBC, which is slow. And although ODBC allows some use of the Visual Studio data designer, it has trouble with parametrized queries.

Also, don't bother with the free version of dotConnect -- it doesn't include the Visual Studio data designer integration. And, if you can, don't bother with the 30-day trial versions either as it's difficult to convert projects over from the trial version to the registered version.

log4net in VS2008 desktop app

The log4net documentation advises one to modify app.config XML file to add a log4net stanza. However, under Visual Studio 2008, this causes an error message

Could not find schema information for the element ‘log4net’

There is a lot of advice on the web on how to avoid this compilation message for web apps, but not for desktop apps. The easiest way in a desktop app (and possibly also for a web app) is to replace in the C# code


XmlConfigurator.Configure(new MemoryStream(
(new System.Text.ASCIIEncoding()).GetBytes(
"<log4net>" +
" <appender name=\"ConsoleAppender\" type=\"log4net.Appender.ConsoleAppender\" >" +
" <layout type=\"log4net.Layout.PatternLayout\">" +
" <param name=\"Header\" value=\"[Header]\r\n\" />" +
" <param name=\"Footer\" value=\"[Footer]\r\n\" />" +
" <param name=\"ConversionPattern\" value=\"%d [%t] %-5p %c %m%n\" />" +
" </layout>" +
" </appender>" +
" <root>" +
" <level value=\"DEBUG\" />" +
" <appender-ref ref=\"ConsoleAppender\" />" +
" </root>" +

Or whatever was in your <log4net> stanza in your app.config