SqlMetal.exe crashes when a column name in the result set is [ ].

The last message to be written to the console was: “Error : Index was outside the bounds of the array.” To reproduce this bug, create this stored procedure and run SqlMetal against it:

CREATE PROCEDURE [dbo].[ThisProcedureWillCauseSqlMetalToCrash] AS
SELECT 1 [A], 2 [ ], 3 [C]

Applies to:

  • Visual Studio 2008 RTM
  • Microsoft Windows SDK v6.0A

Please rate and validate this problem at the MSDN Microsoft Product Feedback Center so Microsoft responds with a solution or workaround.

Some Enterprise Library 3.0 – April 2007 bug fixes

Here are the bug fixes I wrote for Enterprise Library 3.0 – April 2007, related to using the EntLibLoggingProxyTraceListener to proxy .NET TraceListener messages to enterprise library and logging over MSMQ via MsmqTraceListener.

In Microsoft. Practices. EnterpriseLibrary. Logging. TraceListeners. EntLibLoggingProxyTraceListener, comment out
properties.Add(TraceEventCacheKey, eventCache); // line 66 & 146 (fix for SerializationException)
In Microsoft. Practices. EnterpriseLibrary. Logging. TraceListeners. MsmqTraceListener, change queueMessage.Label = messageLabel;
to queueMessage.Label = string.IsNullOrEmpty (messageLabel) ? string.Empty : messageLabel; // line 153 (fix for ArgumentNullException)
In LoggingDatabase.sql, change [Title] [nvarchar](256) NOT NULL,
to [Title] [nvarchar](256) NULL,

ClickOnce progress suggestion


When a ClickOnce application is updating on startup, please display a wait cursor, or some indication to the user that the application is loading – the progress bar currently disappears after the new version is downloaded. On older computers, the time between the progress bar dissapearing and the application loading can take 30-50 seconds…

Internal NullReferenceException in HttpWebRequest when using a CachePolicy

Setting the CachePolicy to the default HttpRequestCacheLevel causes an exception internal to HttpWebRequest when a web application is running with an application pool configured to use a custom identity. For example:

HttpWebRequest request = …;
request.CachePolicy =
new System.Net.Cache.HttpRequestCachePolicy (
request.GetResponse ();

GetResponse () throws a WebException: “The request was aborted: The request was canceled.” Inner exception shows that the private method CheckCacheUpdateOnResponse () of System.Net.HttpWebRequest encounters a NullReferenceException.

A “workaround” would involve loading the user’s profile. For example, if the application pool custom identity is DOMAIN\MyWebApp, log in to the server as MyWebApp. The error goes away – until the profile is unloaded.

This problem does not occur when the web application is using the default application pool identity, NetworkService, because I believe that profile is already loaded by default.

Another bug report is somewhat similar to this but only manifests after a few thousand requests. These are probably symptoms of a much larger bug (or design flaw – http request caching is currently implemented through IE’s cache).

Update: Microsoft has reproduced this bug and will be addressing it in a future release.