Virtual Server, networking doesn’t work…or does it?

I’ve been getting a problem with my Virtual Server machines for some time. It looked like every now and again the VM would not be on the network. Examining the VM event log showed, "could not initialize the emulated Ethernet controller." However whenever I decided to look into the problem it would magically start working again. Well eventually I got fed up with it and decided to have quick web search. Finally I discovered that I’m not alone with this problem and there is a simple workaround for the problem too…

http://connect.microsoft.com/feedback/ViewFeedback.aspx?FeedbackID=214204&SiteID=151
[Edit] It appears this link no longer works, I’m looking into getting the official answer, what this space.

The workaround also goes some way to explaining why I would "fix" it by simply rechecking the settings!

Windows Presentation Framework, first look

I had my first real play with the Windows Presentation Framework (WPF). The first thing that struck me is how like the web model it is. For example, through the use of various services it provides the cascading down of properties and the bubbling up of events. So you can mark a grand-parent property, e.g. color, and if any child node doesn’t specify a colour they’ll automatically have their parents colour value. Similarly the event model is like the web.  You  fire an  event in a child element and the event can bubble up through all of its ancestors, any of which can handle the event.

I only managed a very quick play with the beta Visual Studio Add-in, created a quick "hello world" style application from a button click. I’m not sure if it’s a clumsy beta or it going to work this way but I didn’t get my nice event handler template by double clicking the button. Oh no, I had to guess at event handling code (almost identical to the usual one) and guess where in the Xaml I had to add the click attribute to wire-up the event. But it worked and I hope to have a longer play soon.

How to ignore a field/property during serialization

I’ve hit the problem of serializing a property for the last time. When you create a type that contains a non-serializable type, in my case a CultureInfo class, you cannot automatically serialize the type – you get issues about "does not contain a public constructor", "problem reflecting the type", etc. Unfortunately this isn’t caught at compile time and you have to wait until an attempt is made to serialize the containing object. What to do about it? The more complicated choice is to write some custom serialization code, but really, most of the time I just want to serialize pretty simple objects. So my preference is to mark the class as serializable and let the client choose how to serialize it, i.e. via Binary or Xml "serializers". The framework provides a couple of attributes for this, and this is where the gotcha lives.

The first attribute, [NonSerialized], should be applied to field members and informs the standard serialization methods to ignore the field. The second attribute, [System.Xml.Serialization.XmlIgnore], should be applied to public properties and informs the Xml Serializer to ignore the property. The combination of the two should be enough to stop the field from being serialized regardless of the serializer the client chooses to use.
Quick pseudo example:

[NonSerialized],
private SomeUnFriendlyType myType:

[System.Xml.Serialization.XmlIgnore]
public SomeUnFriendlyType MyType()
….

Finally IE7 allows changes in the address bar URL

When I installed IE7 I was not very pleased. It hardly ever allows me to change the address of the URL and then navigate to that site. It just sits there doing nothing. Originally I trawled the net and found nothing. However, it really bugs me that I’ve got IE7 and it’s next to useless. So after an attempt to re-install it failed to improve anything I did another search and found this…
 
Hurray, after uninstalled the nVidia Network Manager it seems to be working, and perhaps it’s a bit quicker too.
 

Opening Note files (PWI) on a desktop

I’ve been using my Pocket PC to take notes. It’s great, a lot less paper and clutter on my desk and I’ve got a digital record of drawings and the like. However, they’re all stuck on my PDA and I want them on my desktop. Easy I thought, I’ll email them to myself. So a quick right-click on the note and an email later the note file arrives on my desktop. The file format is a special ink file with a PWI extension. Everything I’ve read states that Office 2003 will open them without any problems. I open it with Word and get a nasty custom import screen asking me to map all the odd binary data to text. Hmm, not exactly what I had in mind. So how do I install the PWI converter? After trying the basic, "Add Feature" in control panel I searched the Office and Microsoft sites for the converter. I found one pack but it only contained the same set you get with the install. Then I read about how to use the ink.dll, and it stated that it could be found in the ActiveSync folder. Hmm, perhaps the Office converter is installed with ActiveSync. So I installed ActiveSync 4.5 and turned off all the auto-launch software and rebooted the machine. Opened Word and viola I could open the Note files. So if you want to open Note files in Word, install ActiveSync, even if you don’t connect your Pocket PC to that machine.

SQL Studio – filtering entities

I’m currently using a database with a large number of stored procedures and find it increasing difficult to locate procedures in the ever increasing tree view. However, if you right-click on the parent node in the tree you can set a filter and greatly narrow down your search.

Copy and paste files across Remote Desktop

Today I was shown how to copy a file from your local machine and paste to a remote desktop session. The trick is to ensure you have "use local disk" enabled when you make the initial connection.

Dreamweaver

Had my first play with Dreamweaver for about five years today. I must confess that I’m not a great fan of "design mode" HTML editors and much prefer to hand code it, but it does a good job at auto-completing the tags so that’s all very good. No better than the free Visual Studio Express for Web Developers but there we go. The interested bit was using Dreamweaver with Adobe Contribute. The basic premise is you design a site with Dreaweaver, and allow authors to change the site via Contribute. The clever bit is that you can create templates in Dreamweaver with specific editable regions and specific sets of CSS styles. The in Contribute you can different rules to different roles thereby restricting users to what they can create and edit. It seems to work very well, the check-in system is a bit clumsy in comparison to modern source control servers but is effective. From the authors point of view they can an editor where they can clearly see the bits of the page that are available to them to change. In the drop down list of styles they (if configured correctly) only see the styles the web designer constructed for them to use. Although I couldn’t prevent the use of the horrible justification buttons in Contribute, very annoying. The templates themselves behave in a sort of "master page" principal. If you make a change to the template then it "automatically" (but it does require some help) updates any pages based upon that template. However, I did find the nested concept a little confusing and wasn’t nearly as flexible as ASP.NET Master Pages. Although to be fair the basic templates are much easier to use and I find ASP.NET Master a little nasty to use, certainly for a users stuck in design mode.

Overall I do like Dreamweaver, I think it’s horribly overpriced for what it delivers, at least for the bits I want to use. Contribute on the other hand is a fairly priced product and is a decent no thrills editor for the non-HTML savvy authors.

Using Team System Foundation Server for Source Control

Team System is a great suite of tools, providing you can afford it, for developing software. However, it does represent a significant investment to move an existing team of developers onto it. Rather than moving in a "Big bang" approach my current team are progressing in a steady rate by using all Team System editions for development and we’re about to use Foundation Server’s source control. What we didn’t want to do was take all the process guidance, at least not yet. After some annoying problems installing the software, if ever you need to slavishly follow a readme this is it, I finally got the server running. I had been told that you cannot easily use the Source Control without taking the process guidance. Well this is true, but to a lesser extent. To use the Source Control you must create a Team Project and yes that does involve selecting a process. However, once selected you don’t have to switch on any of the policies. What does that mean? Well when you check code in you do get a dialog that allows you to type in extra details, assign work items, etc but since the policies for the process aren’t on, it doesn’t nag or even prompt you. So effectively you have Source Control like Visual Source Safe but with all the juicy advantages of Team System’s Source Control. Now to get someone else to edit my demo project and see how easy it is to work in the, "don’t lock files when checked out" mode. Sounds like utopia but will probably be more like hell!

Vista and Virtual Machines

I read something a little surprising today. You know all that, "please agree to the…" you get when you install software? Well when you install Vista it says that you cannot install Vista on a Virtual Machine apart from the Business and Ultra (or whatever it’s called) editions. A rather strange thing to do, why should Microsoft care what hardware (or not) it is running on? I could understand if they said they don’t support VM software, after all who’s to say how they fake their hardware, but given the amount of rubbish physical hardware you can buy I don’t understand what they’re worried about. Still if you were not aware of this then now you are…sorry.