Archive for June 2007

21

June 2007

Vista Disk Thrashing - Solved?

I previously blogged about my crazy Vista disk activity and had a few suggestions in the comments. Judging by the number of Google referrals I'm getting for "vista disk activity" and like, I'm guessing these are very common issues.

Since posting, I've actually had very little disk thrashing, and I'm wondering if it's related to the Compatibility and Performance packs I installed around the same time.

I came across this blog saying that turning off paging and prefetch solved his problem. Additionally, the comments in my blog suggest it could be the indexing service. It's worth giving this things a try if you're still having the same problems (after installing the above packs) and see how you get on. Let us know in a comment how you get on.

18

June 2007

Vista - Lots of Hard Disk Activity

Every time I boot my Vista machine up, I hear my hard disks grinding for quite a while after the machine finishes booting and services finish starting up. I also find that if I leave my machine for a while, I'll come back to more hard disk thrashing. With noisy RAID Raptors, and a case made of mesh, it's not a particularly enjoyable sound!

Today I'd had enough, and decided to check on the web if anyone else is having this sort of behaviour. It seems many are. Lots of people are pointing at System Restore, so I fired up regedit to find it runs every 24 hours. This explains every day when I boot it up, the hard disk activity. I don't really want to turn this off, but maybe I could increase the frequency. After all, I'm not often doing anything that should upset the system!

This doesn't address the "idle" noise. I guarantee if I leave my machine for 5 minutes, Vista will begin doing something behind my back, and if I move the mouse, it'll stop within a few seconds. This isn't an accident - Vista is doing something when it thinks I'm not using the machine - but what?

Has anyone else seen this behaviour? Any ideas on what it could be, or how I could track it down? I'm more curious than annoyed - I just want to know what it is!!

12

June 2007

VS 2008: Testing Tools to be included in Professional edition of Visual Studio 2008

In case you hadn't already heard, the testing tools that were previously only available in the Team System edition of Visual Studio are included in Visual Studio 2008! This is great news for those using Nunit because they couldn't afford the Team System editions. Unlike Nunit, these tools full integrate with the IDE!

So, let's have a look. I opened up one of my existing projects, and in the context menu there's a new option for "Create Unit Tests".

If you click this option, you'll be presented with a list of your classes and their methods. You can tick those you wish to generate unit tests for.

The settings dialog allows you to set how the class and method names are generated.

Tests will automatically be generated in a new project, so when you click Ok, you'll be prompted for a name. I'm not entirely sure why this wasn't just included on the previous dialog, but it's not a problem.

Now your tests will be generated. It may take a few minutes - it took a while here, and I only had one test to generate! When finished, you'll see a new project in your solution explorer, and some config files in a new "Solution Items" folder.

In the generated tests is a property of type TestContext. I've never used anything similar in Nunit, but it looks like this allows data-driven tests, where you can have a single test run for every row in a set of data you provide. I can see this being very powerful for testing lots of different conditions without duplicating tests!

To run your tests, you can use the new Tests menu at the top of the window. You'll get build-like progress, and failing tests show similar to compile errors. Double-clicking a failed test will give details, as shown below.

While I love Nunit, I've been annoyed there's been no real (free) integration of tests into Visual Studio, so I'm made up to finally have these testing tools at my fingertips. Move over Nunit, Microsoft are taking over!

The more I use Visual Studio 2008, the more I wish I was using it at work! It's packed with new features that make coding much quicker and less error-prone!

Don't forget, there are also free versions of Visual Studio 2008 (sadly without testing tools!) for the home-coder on a budget!

08

June 2007

The WPF Designer (Cider) part 2...

After Mark Wilson-Thomas, the Program Manager on the WPF Designer team responded to my post about my WPF issues, I thought I owed it a second chance having read his comments.

Locating Controls

My first issue was with the control drop-down being removed. Mark pointed out a few alternatives like the Document Outline window and the XAML Path control. The Document Outline seems to work pretty well, though I'm still not covinced I'll get along with it. Usually when I'm heading for the old drop-down at the top of the property grid, it's because I need to select something I can't easily select in the designer (menu items, controls that are dynamically hidden/shown etc.), and I usually have the name of them in my head. That makes an alphabetical list much quicker than a tree. I know what the item is likely to be called, but not necessarily how it's embedded in a huge tree of SplitPanels. I've also noticed a few minor issues as you can see in my screenshot.

The tree is a bit flat, and not very tree-like, so it's not easy at a glance to see the hierarchy. While this might not seem like a big deal since the drop-down I love was flat, but since the items aren't sorted alphabetically now, it can be a little tricky to find your item. Though this might get easier the more I use it! The other issue is that the small preview appears squashed sometime. I'm not sure if this is a bug, or if it's by design, but the button shown in mine doesn't quite look like the actual button on the form.

The XAML tree is pretty nifty, though a little fiddly to use. You can very easily select a parent of the currently selected item, and an arrow (" /> ") list children. While this is pretty powerful, since it only deals with parents/children, it's probably more likely you'll get into the habit of using the Document Outline instead.

Adding Non-Default Event Handlers

Mark pointed me at Chuck Sterling's blog showing new intellisense that can add event handlers. I'm still not convinced this is as nice as being able to easily see a filtered list of events, it's a nice addition. This would be much more friendly if there was a quick way to filter the intellisense to just list events (though I suspect there won't be).

Finding Properties

Mark hinted at "a better way of locating the properties in the property grid before we ship" which I suspect might be live filtering of properties like in some of the Expression tools (a search box, that hides properties that don't match what you're typing). Withing seeing it, I can't say whether it'll be as natural as looking for properties based on what letter they start with, but I'll post my thoughts when if and when I see it.

Rendering Issues

As for the rending issues, I managed to get a screenshot of the kind of thing I'm seeing. This particular issue shows up when I hit "Swap Panes" to replace the XAML with the Design view. It always renders the hosted WebBrowser control, but nothing around it. When I click anywhere on the surface, everything else appears.

Here's screenshots showing what's displayed after clicking the "Swap Panes" button and the expected view (which happens when I switch to XAML then back to Designer normally).

Update:

I've posted to the Cider Forums as requested.