Expression Blend 2 in MSDN

A bit of an unusual post this one but someone asked me at an event last week;

"How come only Expression Blend V1 is on MSDN and not V2"

Now, this struck me as a little odd but I don't have an active MSDN subscription at the moment ( note to self - get that fixed ) so I couldn't immediately check. I got Mike to have a look for me a second ago and it does seem that V2 is indeed on MSDN.

So...if you are the gentleman that asked me, take a look at the MSDN site - it's there :-)


Filed Under:

DevDays Amsterdam Content

I never knew this was here but the content from DevDays Amsterdam with sessions from my self around ADO.NET Data Services and ADO.NET Entity Framework are all available online up here;

http://www.microsoft.com/emea/msdn/spotlight/event.aspx?id=102

There's also a lot of great material up there from my former colleague Daniel Moth and some other great folks such as Rafael Lukawiecki, Ingo Rammer, Christian Weyer, etc.

Nice resource.

Vista Complete PC Restore, 0x80042401, DiskPart, WbAdmin

I picked up a new laptop, a Lenovo T61P to go alongside ( or, more likely replace depending on the "powers that be" ) my existing HP NC8430.

I wanted to kick start the process of moving from one machine to the other or of running the two in tandem by imaging my existing hard-drive to the new machine.

My existing hard-drive is a 200GB 7200rpm disk and the new one is a 160GB 7200rpm disk. I have about 50GB free on my existing hard-drive so that doesn't seem too limiting.

I used the Vista "Complete PC Backup" feature and that worked a treat on the source machine in terms of creating the image.

However, then the fun and games started.

I booted the new PC from a Vista DVD ( note - this was a Vista RTM DVD as I don't have an Sp1 DVD and that might be the root cause of the problem I encountered ).

I went into the "Repair my PC" screen and then tried to restore the complete image backup. No dice. I kept getting error 0x80042401 which is in many online forums and says something along the lines of "You have too few disks in the machine or the disk(s) you have are too small".

I went through a long process on this, cutting down the size of the transfer by only backing up the C: drive and playing with various options until I learned to spend some time in the recovery console ( also launched from the Vista DVD ) and, specifically, using 2 commands from there - diskpart and wbadmin.

In the end, the way that I got this all to work was by first using wbadmin to take a look at the backup image that I'd used. I'd use something like;

wbadmin get versions -backupTarget:z:

where z: is the USB drive that has the imaged backup on it.

That'd then give me a version id that I can use in other commands such as;

wbadmin get items -backupTarget:z: -version:01/01/2008-00:00

where the version parameter came from the previous get versions command. This would now show that I had 2 "items" in my backup for my C: and my D: drives from the original PC.

I then used diskpart to try and create partitions on the new machine that matched partitions on the old PC in terms of size and filesystem in as much as possible. I'm not sure how essential this actually is but the sorts of commands that I ended up running were things like;

list disk

list partition

list volume

select disk

select partition

select volume

create partition

create volume

format

assign

active

clean ( when it all goes wrong - take care which disk you have selected before doing this )

Once I had that in play, I used something like;

wbadmin start recovery -backupTarget:z: -recoveryTarget:c: -itemType:volume -items:c: -version:01/01/2008-00:00

to actually perform the recovery and it seemed to do what the UI wouldn't do.

When I actually tried to boot the machine with the new drive image in it, it kept blue-screening.

I scratched my head a lot over this until I made a random guess and switched the SATA setting in the BIOS to "Compatibility" rather than AHCI and that resolved that one for me. Not sure whether I can then reconfigure that at a later point but it got me over the blue-screen hurdle for the moment.

All in all, I'm glad that it works but it doesn't feel like it should be rocket-science to image a hard-drive from one place to another. I've a feeling that the GUI experience is less limiting if you have an Sp1 disk rather than a RTM disk.


Filed Under:

XBAPs are Rich Internet Applications

We did an event the other day that was called something along the lines of;

"Building Rich Internet Applications with Visual Studio 2008 Service Pack 1"

as part of that, we spent some time talking about Silverlight V2 and some time talking about WPF as it stands in .NET Framework V3.5 Service Pack 1.

One of the pieces of feedback that I got ( I did the WPF part of this session ) was something along the lines of;

"What has WPF got to do with building Rich Internet Applications on Service Pack 1?"

perhaps I didn't do a very good job although ( trying to rebuild my ego here ) it was just one comment out of quite a lot.

So....I took that version of "WPF Airlines" that I ported the other day ( from here ) and repackaged it as an XBAP below;

XBAP Deployment of WPF Airlines

Now, here's some thoughts about this application;

  1. It's Rich. Now, it's not perhaps the richest application that you've ever seen but this is WPF V3.5 Sp1 so it can be extremely rich if it wants to be. It just so happens that this sample isn't using all of WPF.
  2. It's served from the Internet. It runs online only. It runs inside a browser. It runs inside a sandbox without any "Do you trust this application" style clicks.
  3. It's an Application. Don't think there's any doubt about that although clearly it's just a sample with no calls off to back end web services.
  4. I built it with Visual Studio 2008 Service Pack 1.

For me, this XBAP is a Rich, Internet Application. If it's not a Rich, Internet Application for you then I'd be interested in why it's not? Possibly the definition of Internet isn't how you think of Internet?


Filed Under: ,

Windows Presentation Foundation, Event Samples

I did a talk down at the Microsoft offices in Reading today which was called something like "Beyond Silverlight with WPF Clients". One of the attendees asked me to share my demos and so here is my attempt to do that here. I hadn't originally intended to do this so some of these things are perhaps not as re-usable as they could be.

By looking at my list of shortcuts, here are the demos that I showed. Note that XAML files will be .XML files here because my web server won't serve up .XAML files if I remember correctly. Also, where I might have actually typed a bit of XAML into some of these examples to "complete them" I've already completed them here so there's nothing to add.

  1. 3D Spinning Cube
  2. Documents with UI embedded
  3. HTML Embedded in WPF content
  4. Speech
  5. Visual Brush
  6. Bitmap Effects
  7. Pixel Shader Demo ( this is not mine, it came from MIX 08 - trying to find a public internet link to it )
  8. Windows Forms/WPF Interoperability. I built this up by just doing "File->New->Project" in Visual Studio but Daniel covers it off nicely here.
  9. 2D on 3D.
  10. DataGrid demo - I built this one up on the fly too. Really was a "Hello World" around the DataGrid.
  11. .NET Client Profile. This involved a Virtual PC image :-) However, I did make a video of the whole thing up here.
  12. "WPF Airlines".
  13. Component demonstrations...
    1. Infragistics
    2. ComponentOne
    3. ActiPro

Enjoy. I'll see if I can hunt down the other bits and will update the links if I can.

WPF Airlines

I often hear of the "Source Code Compatibility" between Silverlight and Windows Presentation Foundation and so today I thought I'd try it out a little bit.

Personally, I don't view this as;

Take your SL source code, add a few bits and pieces and you have a WPF application. Add a bit of conditional compilation where necessary.

I don't have a perfect picture of it in my head but I see it more as perhaps;

Build both a Silverlight and a WPF UI. Try and build components that can be built to underpin both. Most of what you've got will build/work on both frameworks and then you'll perhaps have a remaining 10% or so that's similar but different enough to want to separate out to being WPF/Silverlight specific.

I still think it sounds challenging and I'm not sure how you'd do (e.g.) source code compatibility between Silverlight controls that are using the VSM and WPF controls that aren't. That feels like a tricky one to get right and I suspect that there are a whole bunch of other areas that need a lot of thought to try and get this to work.

You could argue that you pick a control set that's common across both Silverlight and WPF ( i.e. the common Microsoft control set and perhaps a 3rd party control set that supports both ) and use those. That might help a whole lot in raising you above the WPF/Silverlight differences.

I can definitely see that you can re-use your knowledge and skills across the 2 frameworks. That's a given. I can also see that you'd re-use a whole bunch of XAML by just lifting it from one framework to the other, changing a few bits and pieces (like the namespace :-)) and then getting it linked up with some code and running.

Anyway...I wanted to experiment and so I thought that I would port an existing Silverlight application to WPF.

I chose Silverlight Airlines.

On reflection, this was probably a bad choice :-) From looking at the source for Silverlight Airlines you can tell ( I think ) that it was written for Silverlight V1.1 rather than Silverlight V2.0 in that it does quite a lot of dynamic loading of XAML rather than use the control model that showed up in V2.0. It's nicely structured there so you can pretty quickly get to grips with it.

I chose to do what I call a "literal" port of it in the sense that I just took what was there and hacked at it until I had it running on WPF. I made no attempt to do things in any kind of "better" way but just tried to get it across to WPF. There are some specific things around resizing that I don't think you would do in a world of Grid and so on but the code is all Canvas based from the V1.1 preview.

I'd say that it took me about 60 minutes and of those 60 minutes I reckon I spent around 45 just monkeying around trying to figure out what to set the build option on my XAML files to and why the XAML files weren't being loaded by Application.LoadComponent and so on.

The last 15 or so minutes were probably spent in a debugger trying to figure out why certain animations weren't where they were expected to be and switching a few calls to FindName() to look into Resources collections.

I put the source code here for download. This is not my code and so I possibly have no rights to distribute it but it's a public sample so I figured no-one would mind. If you do mind, mail me and I'll remove it and update the post.

Here it is running on Vista in all it's glory :-) Don't worry about the crazy looking colours - that's just my desktop shining through the glass.

image


Filed Under: , ,

.NET Client Profile ( 3 )

I got so excited about the .NET Client Profile that I made a screencast about it and stuck it on Channel 9;

http://channel9.msdn.com/posts/mtaulty/WPF-ClickOnce-and-the-NET-Client-Profile/

When will I get a life?


Filed Under: ,

Get Your IE8 Beta 2 Whilst It's Hot

From here.

This will be my first leap into the world of IE8.

The .NET Client Profile ( 2 )

Following on from this post I wanted to see if I could get my Client Profile installation to work with ClickOnce. To be honest, I struggled quite a bit with this.

Sticking with my "Hello World" WPF application, I made sure that on the Publish tab of my projects' properties I had selected what to do about pre-requisites;

image

and then I altered a few paths to point the ClickOnce process to my web server and told VS to publish it. The publishing process looks to drop out what you'd expect in terms of pushing out the .application file for ClickOnce deployment but you'll find that if you point someone to a .application file and they have IE7 without any .NET Framework then they get a dialog from IE7 saying something like;

Hey - you don't have the .NET Framework. Would you like me to go and get it for you and install it?

This is not what I want to do here because it springs off into downloading the full .NET Framework ( 3.5 I think but perhaps that'll be updated to Sp1? ) from the web which means the 60MB download and then the reboot.

However, the publication process also drops out Setup.exe which is our old friend, the online bootstrapper.

If I run Setup.exe then it'll first off go through the process of installing the .NET Client Profile again and then it'll follow that up with a ClickOnce installation of my application. Quite cool :-)

Naturally, if I then update my application and re-publish it ( assuming that I asked the application to check for updates in the first place ) then the application will do the usual ClickOnce thing of picking up updates as/when they're published to the installation server.

Next stop is how to customise this setup process.


Filed Under: ,

My Web Server's Dead - Corrupt applicationHost.config

Hmm, today I find that IIS on my laptop suddenly won't start as it has a corrupt applicationHost.config file. The event log says;

The Windows Process Activation Service encountered an error trying to read configuration data from file '\\?\C:\Windows\system32\inetsrv\config\applicationHost.config', line number '0'.  The error message is: 'Configuration file is not well-formed XML
'.  The data field contains the error number.

and that's certainly true because when I look in that file it looks empty but, in fact, it's blanked out with zeroes from opening it up in VS.

So...what to do? I've found various posts in forums saying "Reinstall your OS" but I really don't have time for that. Many of those posts link this up with AntiVirus software damaging the file.

I switched on my Vista desktop in order to see if I could copy a similar file from there and it "exploded". Something made a very loud bang and there was a strong smell of smoke. Not sure whether the power supply's gone or what but it doesn't smell too sweet so that's not going to help right now. I hadn't switched that box on for a while and clearly it's been sulking waiting to electrocute me at the first chance that it got.

I then realised that all is ok because only 3 days ago I backed up my entire laptop with a "whole machine" backup.

I go to try and restore this one file out this backup set and I find....it doesn't do that :-(

The Backup UI says;

image

And if I go into the Advanced Restore option and click on the "Restore Files" option I get;

image

and if I do the advanced thing and point it at my external backup drive then I get;

image

I guess I've never really understood ( or cared ) about the difference between "Whole Machine" and "Non Whole Machine" backups and now I'm paying the hard way. I'd kind of assumed that if I did a "Whole Machine" backup then I'd be able to pull files out of it individually at a later point but maybe you can't. It would be very nice if you could - for me, there's nothing worse than a Backup feature that proves to be unforgiving when you come to use it :-( I guess it's my fault for not reading all about it at some point although I do generally copy my own files manually to an external drive for just this situation but I tend not to copy IIS files as well.

However, I then found this TechNet article;

http://technet.microsoft.com/en-us/library/cc735294.aspx

which pointed me to the right history folder ( I'd seen a forum post that had directed me to the wrong history folder ) and I found a recent history file and copied it over the top of my applicationHost.config and restarted IIS and all was well (for now).

Phew.

More Posts Next page »