Arrived in San Diego @ TechEd

One Uneventful pair of connecting flights, a car rental pickup and a check in at the hotel. It's the calm before the storm....you know, the calm associated with hotel internet access actually working. You know it's a computer conference when you can see 5 wireless access points from various people's hotel rooms, and I'm on the corner of the hotel!

I kind of drove in the back way and haven't been near the convention centre yet to check out the buzz, but I will tomorrow. The MCT day starts at 7:30am at the Marriott next door. I better get to bed.

There is a bit of a buzz on email right now - stuff I'm not allowed to talk about until Monday - but it's one of my speculations. More about that on Monday. There will be a lot of announcements on Monday. Stay tuned.

SQLDependancy Caching

One of the new features in version 2.0 of ASP.NET is a new form of cCaching. This is a cool feature but not as easy to get working as it would seem.

In case you haven't heard about it, using SQL Dependency you can tell the Web Page not to refresh until the DB notifies it that the data has changed.

There are three steps you have to do to get this feature to work.

1. Add this section to your Web.Config file:

<connectionStrings>

<add name="pubs" connectionString="Integrated Security=SSPI;User ID=sa;Password=sa;Data Source=LONDON;Initial Catalog=pubs;Persist Security Info=False;Workstation ID=DLLOYD" />

connectionStrings>

<system.web>

<caching>

<sqlCacheDependency enabled="true" pollTime="500">

<databases>

<add name="pubs" connectionStringName="pubs" />

databases>

sqlCacheDependency>

caching>

system.web>

Watch out because there are articles out there that say the tag should be CACHE not CACHING

2. You have to run an administrative utility (aspnet_regsqlcache) that enables a Database and Table for SQL cache dependency.

aspnet_regsqlcache -S (local) -U "sa" -P "sa" -d pubs -t authors -ed (Enable the DataBase)

aspnet_regsqlcache -S (local) -U "sa" -P "sa" -d pubs -t authors -et (Enable the Table)

aspnet_regsqlcache /? (Too see all the commandline switches)

3. On the page itself, in the Page Directive add the following line.

<%@ OutPutCache Duration=6000 SQLDependency=“pubs:authors“ VaryByParams=“*“%>

Microsoft Business Framework goes into Longhorn/Orcas

MBF is being delayed until Longhorn. Up until reading this, it was my understanding that MBF was planned for a post Whidbey release along with ObjectSpaces. MBF is a pretty big thing scope-wise. I think it is the right thing to do to wait until Longhorn. I just hope ObjectSpaces doesn't fall into that same planning.

Uninstalling Whidbey PDC Preview

For anyone else who received the recent Whidbey 2005 preview. And thought they would uninstall an older version of Whidbey. Here is what happened when I did it.

  1. I un-installed Whidbey.
  2. Then I had to separately un-install:
    • Microsoft .NET Framework 1.2
    • Microsoft Visual J# redistributable Package 1.1
  3. Then to get Visual Studio 2003 working properly again, I had to reinstall:
    1. Visual Source Safe
    2. MSDN Library

And everything seems OK so far.

OpenSource Project for Testing Microsoft Software

Over the past few months, when I question how something works in the .NET Framework (or when somebody asks me).....I have been creating NUnit tests to verify the behaviour of some class and/or methods in the .NET Framework. Initially it is just to observe the behaviour or verify some assumptions, but by the time I'm finished, I usually inject various Assertions into my tests to tighten them up. These now serve as a test bed for me moving to a new version (or even old versions) of the .NET Framework. I can answer the question: Are any of my assumptions about how the 1.1 framework works broken in 1.2? 2.0? 9.0? etc.

I'm building up a nice collection and I might publish my work. But it struck me that this could be an open source project. In fact, I think it should be an open source project and I think it should be started by Microsoft....and not necessarily for the .NET Framework alone - but that would be an easy place to start.

Microsoft has faced increasing pressures over security and quality of their software - to the point that they've actually made windows source code available to key customers, governments and MVP's. I think that's a bit risky if you ask me. I think it is also a bit hypocritical to point the finger at Linux for being “more hackable because source code is available“ but at the same time make your own source code available to the chinese government.

But why not publish the source code to unit tests (say NUnit fixtures) in an open source format for the community to contribute to. When one of these security firms finds a hole in some MS software, they could create an NUnit test to expose it and submit it to Microsoft to fix, and then make the code for that NUnit test part of the open source project.

Instead of publishing source code, which is really meaningless to give people any kind of comfort in the code, publishing unit tests is publishing assumptions and expectations about what software is supposed to do and how it is supposed to behave. I would think this would become more important over time especially moving towards WinFx and Longhorn.

Building Maintainable Applications with Logging and Instrumentation

I'm doing this MSDN webcast in a few weeks

10/05/2004 1:00 PM - 10/05/2004 2:00 PM (EasternTime)

In this session we'll cover the world of logging and instrumenting your application. We'll discuss the various .NET framework components as well as higher level services as provided by the Exception Management Application Block, the Enterprise Instrumentation Framework and the Logging BLock. We'll discuss the various issues with persisting information in file logs, the event log, and WMI Performance Counters. We will also compare other alternative technologies such as log4net. We'll also discuss best practices for loging and instrumenting your application and provide some considerations for when and where it makes good sense to instrument your application from experiences in the field.

Update: The slides, samples and livemeeting recording links can all be found here.

Things I don't like about NUnit

Firstly - I love NUnit - and nobody has done more to increase the quality of .NET Applications than the contributors to this project - nobody.

But I know that next generation Unit testing framework authors are listening so I might as well state the things I'd like to see:

  • I'd like to be able to run a single test from the command line. Not just a single fixture, but a specific test.
  • I'd like my tests to be parameterizable. I'd like from the Command Line to run a test and provide the specific values.
  • Wouldn't it be cool to create a batch file of scenarios? What about doing this in XML? Duh - no brainer.
  • A lot of my tests in this case would simply wrap up and call business objects - so why not be able to have a virtual test in the xml file? That is just call a class/method directly with XML.I'm not saying this is the be all / end all - really the only kinds of assertions I could do realistically would be to test for certain exceptions or no exceptions. Return values? Possibly - but really - some times our methods accept and return things other than value types - but this might be a nice thing to have regardless.

With these things in place, one could conceivably:

  • tie a class modelling tool into test scenarios. Hmm, I need a class, with a method and if I pass this data, I should get these results.
  • If an end user reports a bug in my defect tracking system, I should be able to create an NUnit test that exposes this bug. Then my support people can come back from time to time, have the defect tracking system run the test to see if it's been fixed in a given patch/release/build, etc. and update the status on the defect.

 

 

ASP.NET Whidbey at CTTDNUG Tonight.

I'm presenting an overview on ASP.NET 2.0 tonight at CTTDNUG.

There isn't a great abstract on the site - and in fact, I will physically be unable to do the objectspaces stuff since the new version of VSNET CTP doesn't even have it in it anymore. Don't read into that - objectspaces will still be coming out - at some point. I should be able to give some nice objectspaces PPT's if the crowd is interested - but I'm guessing that Demo's are going to be more enjoyable.

So I am going to do my best ScottGu thrie impersonation and give a good solid demo lap around ASP.NET. IDE Improvements, Master Pages, the new datasource stuff, Site Navigation, Security, Personalization, SqlCaching.

Whidbey and Yukon names and dates tighten up

So I've heard that Yukon (Sql Server) and Whidbey (.NET 2.0?) are being now committed for “the first half of 2005”.

Furthermore, it can be confirmed that the names Sql Server 2005 and Visual Studio 2005 are the official names. Officially, I believe this is a 6 month slip. http://msdn.microsoft.com/vstudio/productinfo/roadmap.aspx. That's not too bad in the grand scheme of things...and of course, we all want to wait as long as it takes to get it right.

ADO.NET rant

Why is SqlDbType in the System.Data namespace when all the other provider specific types are in their own specific provider namespace? There is definitely some ugliness going on here. I'm not sure it's entirely a mistake.

As an aside, why is it SqlDbType and not SqlType? I can understand why OleDbType is named the way it is, but OracleType and OdbcType seemed to be named appropriately. Maybe it has something to do with the fact there is a System.Data.SqlTypes namespace and that would be just too close for comfort in the naming. Ok, so why isn't there an OdbcTypes namespace or any other types namespace for that matter? And shouldn't System.Data.SqlTypes be under System.Data.SqlClient.SqlTypes?

So what's the deal with IDataParameter and it's descendent IDbDataParameter? All of the typed provider parameter implementations implement both of these. Shouldn't they be collapsed into one? Even the IDbCommand.CreateParameter method has to return a IDbDataParameter. Furthermore, the online help for IDbDataParameter says it includes stuff for mapping to dataset columns. That's odd because the only 3 members of IDbDataParameter are Precision, Scale and Size. I'm pretty sure none of those having anything to do with Datasets. In fact, it's IDataParameter that provides this mapping in the SourceColumn member. Sheesh

Talk about your inconsistencies. It's still in WinFx from what I can tell. Please someone tell me there is a reason for this madness.