Wednesday, April 11, 2007

"Generating user instances in SQL Server is disabled. Use sp_configure 'user instances enabled' to generate user instances."

Just in case you ran into the same problem: 1. Open the SQL Server Management Studio Express. This is the downloadable program in the same site where you downloaded the SQL Server 2005 express used to manage SQL Server 2005 Express. 2. In the query editor type this text (everything between the double quotes): "exec sp_configure 'user instances enabled', 1" 3. Execute the query, e.g. by clicking the "Execute" button. 4. Clear the query window, then type (everything between the double quotes): "Reconfigure" 5. Execute the query. 6. Then restart the SQL Server database, e.g. in SQL Server Configuration Manager or by simply restarting the service in the control panel. This solution is based on a forum entry by 'kabalweg' I found at an MSDN SQL Server Forum. And yes, it did work for me. And yes it works for both SQL Server 2005 and SQL Server 2005 Express.

Tuesday, April 10, 2007

C# Grammar

In case you are looking for a document that contains a C# grammar, then check out the ECMA-334 (PDF, 2.6 MBytes) specification. Starting with page 65 (or 87 of 553 if you use Adobe Reader) you'll find both the lexical and the syntactic grammar for C# 2.0, e.g. including generics, etc.

Thursday, April 05, 2007

FormatException thrown by Convert.ChangeType Method

According to Microsoft's online documentation the method Convert.ChangeType(Object, Type) can throw the following two exceptions:
  • InvalidCastException
  • ArgumentNullException

Unfortunately, this list is not complete. When you try to convert the string "oops" to int32, this method throws a System.FormatException with the message "Input string was not in a correct format."

In this regard the online documentation for .NET 2.0 is incorrect. The behavior might be the same for .NET 3.0. I didn't verify the latter.

Tuesday, April 03, 2007

What's next for csUnit?

Now, that csUnit 2.1.2 has been released the question is certainly what is next for the tool. Here is my take. I think that one of the next items will be a simple first version of parameterized tests. We have looked at what other xUnit based testing frameworks offer, and there are a lot of very good ideas out there. The way csUnit will support it will certainly be inspired by what is already there. However, we also believe that in some cases the available implementations have shortcomings. Some unit testing frameworks don't offer parameterization at all. Others offer it, but are somewhat limited with regards to where the parameter values can come from. It would not surprise us if you had some thoughts on this as well. Please share them by posting on the "Open Discussion Forum" on SourceForge, or by sending an email to manfred at csunit dot org. Thanks!