July 2003 Blog Posts

NUnit 2.1 Beta 1 Released: At long last, NUnit 2.1 is released in its initial Beta version. Highlights of this release include support for the .NET framework 1.1, the ability to run test suites across multiple assemblies, improvements to the GUI interface, new command line switches for both GUI and Console runners, some degree of integration with Visual Studio and new TestFixtureSetup and TestFixtureTeardown attributes.

sitecopy is a program for maintaining and synchronizing local and remote copies of web sites. The program will upload files to the server which have changed locally, and delete files from the server which have been removed locally, to keep the remote site synchronized with the local site with a single command.

Two tools make up the IIS Debug toolkit and are designed to help figure out what requests were in flight when IIS terminates unexpectedly or take action when a request hangs. Use this tool if you notice IIS terminating unexpectedly or if you want to figure out why a request is hanging. [ Microsoft Download Center]

Useful IIS troubleshooting tools.

Scott Hanselman's Weblog: If you've ever had to call a VB6 Component from an ASP.NET (ASMX) XML Web Service, you may (most probably) get threading errors. In ASP.NET Apps you can mark the Page directive with "ASPCompat='true'" but there is not a equivalent tag for Web Services.

Adam Nathan: Gotcha with STAThreadAttribute and Managed C++

Fun with MC++ and STAThread attributes not being exposed correctly.

VSIP Developer Community Center: Register to become a Visual Studio Industry partner and get FREE access to the VSIP SDK. As a VSIP you will have access to the technology, private newsgroups and secured technical content to assist you in seamlessly integrating your tools, components, and languages into the Visual Studio .NET IDE.

Looks like we finally get free access to VSIP. Hopefully this will spur the development of loads of useful integrated VS.NET tools now.

Someone please fix the braindead implementation that loads the whole file into memory before returning it to the client. [Simon Fell]

Damn straight! We need something with HSE_REQ_TRANSMIT_FILE/TransmitFile semantics.

Duncan points out a little something extra that VB.NET's Try...Catch syntax supports. It's something the underlying IL supports and it seems useful, so we figured, why not? A use that comes to mind is when dealing with COMExceptions:

Try
' Do some COM interop
Catch ex As COMException When ex.ErrorCode = &H80043919
' Handle this specific error
End Try

Nothing fancy, just a little something extra. An interesting thing to note is that the CLR doesn't actually support specifying both a type filter (i.e. ex As COMException) and a filter expression (i.e. Where ex.ErrorCode = &H800043919), so the above Catch clause is a filter expression that checks both the type and the value together. It doesn't use a type filter. I was never really clear why the CLR did it that way, but it's not a big deal either way. [ Panopticon Central]

Not sure how useful this will be, but you do learn something every day!

Scott Swigart: Also, yes, VB existed before .NET, but I don't see what's muddled about the language. If you want to see a kludge, look at what happened to C when it turned into C++.

How about the way that VB uses () for both array syntax and calling constructors so that when I type New MyObject(3) I have to add braces to indicate that I meant an array not passing 3 to a constructor?

All languages have their foibles, but after using VB.NET more during the last few weeks, it does seem to suffer from more arbitrary grammar decisions than most.

iunknown.com: Steve Shockley set me a pointer via my comments to the Windows Compact Disk Management Script. Thanks, Steve! I wish I had known about this BEFORE I downloaded 2GB of ISO images for Win2K, WinXP and Win2K3 from MSDN. My MSDN universal subscription doesn't ship the ISO images - just the CD layouts on DVD's. This utility would have saved me a bunch of time; I hope this link helps out somebody else.

iunknown.com:

If you're using V1.1.4322 of the frameworks, and you're writing unit tests using NUnit 2.0, you'll need to add the following to both the nunit-console.exe.config and nunit-gui.exe.config files:

<startup>
  <supportedRuntime version="v1.1.4322" /> 
</startup>

NUnit 2.0 is compiled against V1.0 of the frameworks, and at some point you'll wind up trying to load both V1.0 and V1.1 versions of mscorlib.dll, which is prohibited by the CLR. By adding this to your application's configuration files, you'll force the NUnit test harness code to run under V1.1 of the frameworks, thereby solving your problem without forcing you to recompile the NUnit binaries.

Hmmm...should probably have thought about this before I charged off and rebuilt the binaries using 1.1...

Download the WSE 2.0 Technology Preview, which includes a policy framework, enhanced security model, and a lightweight, message-oriented, SOAP programming model. [MSDN Just Published]

Richard Birkby points to the Dr GUI article about locking with static methods: A Special Dr. GUI: Don't Lock Type Objects!

I had seen this before but a reminder is always worthwhile.

After what I wrote yesterday, I came across PaulV's comments on the same subject:

So, in the end, I think the whole "C# vs VB" argument is a non-starter. The real question is: are we doing a good job making your life easier? Are we the best tool for developers out there? That's the important thing and what we focus on every day.

Panopticon Central: Essentially, if you know that what you're converting is exactly what you say it is, then you can use DirectCast to bypass the little bit of overhead that you incur by using the runtime helper.

So even though a lot of C# developers wish VB would just go away, it's not going to happen. [Sean 'Early' Campbell & Scott 'Adopter' Swigart's Radio Weblog]

I'm looking forward to the feature divergence between C# and VB.NET that will no doubt begin next year. I think that will make a lot of the arguments disappear. I'm all in favour of picking the right language for the right task - surely that's what the language agnostic Common Language Runtime is all about. It's tough at the moment to choose between C# and VB.NET while the discernible differences are small.

From what I've read, the idea is that as time goes by, C# will develop more complex functionality that more naturally sits with the brace-language crowd whilst VB.NET targets the more RAD approach and keeping things simple.

The problem is that this falls down in some areas at the moment. Let me give an example. I'm currently involved in an n-tier VB.NET project and as such we have a namespace hierarchy reflecting different application areas and different tiers. To hide some complexity from VB.NET developers, the projects have a default namespace to save having to make namespace declarations in each file. If you declare a namespace it prepends the default namespace to the name you have declared (e.g. if you default namespace is Company.App and you declare Namespace Internal then classes here will be in Company.App.Internal). I'm sure in the long run this causes more namespace confusion than it solves. We've actually run across an issue where VS.NET Intellisense will allow you to drill down into a namespace to reference a class only to then discover that the code it helped you type won't compile because of the way the default namespace affects name resolution in code. I'm sure it would be easier to explain namespaces to a new developer than it is to explain how the compiler finds classes using the default namespace (which seems a bit of a mystery anyway).

simplegeek: I once talked to a guy that ran a game development company. He talked about the artists that he employeed. Developers, he said, saw problems as black and white - you either solved the problem or you didn't. Artists, however, see problems as red and blue. Neither is right or wrong, rather one is red and one is blue. The key, he continued, is to never have a red/blue person work for a black/white person.

I just downloaded a copy of ActiveSMART after my BIOS told me to replace my HDD on my desktop computer. The only reason I noticed this was because I had to replace the power supply in my desktop.

...

I found that this utility does a great job of telling me exactly what my HDD's are up to on my computer. It also helps to demystify for me exactly what S.M.A.R.T. diagnostics actually are. I've also got it set up to email me alerts if one of my computer's HDD's are about to go south (it polls your HDD's diagnostics every hour). It's well worth the $24.95. [iunknown.com]

I'm running SMART Defender which I got from IBM (apparently they recently sold their hard drive business to Hitachi so you get it there now). It's a free download and it says it monitors SMART-capable IDE and SCSI hard drives so presumably it works with other makes too. I don't know if it works - I hope I don't find out, but it is reporting a healthy status on my disk at the moment. See http://www.hgst.com/hdd/support/download.htm#smart.