Thursday, 21 January 2010

Sometimes It Just Works

Some things in life that just do what they say they will do and when this happens you get blown away. 

VMware Workstation says it lets you use Visual Studio to debug an application that is running on a virtual machine.  I used this recently and was blown away by how easy it was to set up and by how amazingly useful it was.

The story is that I released a new build for informal testing, but it could not be installed.  I installed it onto a clean XP VM (yeah, I should have done that already…) and got the error myself.  However, there was no error information coming back from the application as the failure was happening before the logging layer was instantiated.

I was stuck.  I could reproduce, but had no other information to help.  Then I remembered that VMware Workstation had the facility to debug apps running on VMs.  So, I followed the instructions (yes, I was desperate enough to read the VMware help file!!) and set up a VM for remote debugging.  This was pretty swift to achieve and I then started a debugging session on the VM from Visual Studio. 

Almost immediately I could see what was happening: it was my bad – I’d just forgotten to include a third-party assembly with the build.  My dev box was happily loading it from the GAC and so I couldn’t see I’d missed anything.

VMware Workstation just did what it said it would do.  in doing so, it got me out of a sticky situation.  Also, it says it has the ability to record and replay a debugging session…maybe next time, eh?

In the meantime, and whilst loving the things that go right, here’s a shot of the error from VS debugging on the VM:

image

Thursday, 7 January 2010

Friendly OS Name from WMI

When you want to find out what operating system your application is running on, System.Environment.OSVersion is not very readable.  You can get a nice friendly name using WMI like this:

  1: private static string GetOSName()
  2: {
  3:    const string query = "SELECT * FROM Win32_OperatingSystem";
  4:    var searcher = new ManagementObjectSearcher(query);
  5:    var results = from x in searcher.Get().OfType<ManagementObject>()
  6:            select x.GetPropertyValue("Caption");
  7:    return results.Any() ? results.First().ToString() : "Unknown";
  8: }


This will give you something like "Microsoft® Windows Server® 2008 Enterprise ".

Saturday, 18 April 2009

Cloud Computing – SMD Services

Rinat Abdullin has recently put up an interesting post about cloud computing, along with another post as a response to a comment of mine.  Rinat pointed out the benefits cloud scenarios bring when there is a need for distributed computing resources, highlighting Amazon’s recent announcement along with Microsoft’s offerings in that space

I agree with Rinat that distributed computing scenarios are clearly winners for cloud computing.  However, my view is that one of the critical success factors for the success of cloud computing will be developer adoption.  If you have developers using your product it will succeed (as a cloud platform), if you don’t then…well, you get it!  My view is that the larger organisations who already have their own infrastructure will certainly adopt cloud resources, but it will not be these organisation that will drive the adoption of cloud technologies.  It will be the small to medium enterprises (SME) for whom the effort to host themselves is a large compared to their overall effort to stay in business.

What is going to drive SME uptake – having software that delivers business advantage.  How does this get to them – by developers producing it for them.  Making your cloud platform accessible and usable for developers will drive wider adoption.

In Rinat’s second post he mentions a scenario where if he had had a cloud platform like Azure available, cost could have been saved.  He also outlines the basis for how cloud computing will reduce the overall costs of the adoption of a the provided in the cloud – the larger data centres selling their idle CPU cycles. 

He then points out that there is fast evolving market for hosted developer environments where you can easily and cheaply access version control, wiki, issue tracker services, etc.  In an earlier post I mentioned one such provider, WUSH, with whom I have had a positive experience throughout the last year in the smaller scale development work I do out of normal working hours. 

It is this area – developer services – that I see as the key to making cloud computing ubiquitous.  If you can provide developers with full-lifecycle support from your platform they will come in their droves.  By full lifecycle, I mean support for planning, production, test and live all in an integrated set of cloud services.

As mentioned, there we see some support for planning and some aspects of production already out there (search for “hosted subversion”, take a look at Scrumy or Manymoon, etc.), and you can but cost efficient test and live  environments (by renting your own server).  But to get other aspects running, like a build or CI environment, involves setting it up yourself on a server you have rented yourself.  However, doing that would not be using SaaS beyond having a server hosted in the cloud.  Unfortunately, I know of no decently priced build service that for commercial projects.

What do I want to see?  In the short term, I’m missing a sensibly cheaply priced build services for commercial projects (see James Kovac’s recent announcement of their new Team City service for OS projects).  In the longer term I want to be able to have a fully hosted CI environment that prices me by disk and CPU usage. 

The ultimate goal: Microsoft to host TFS and reduce the cost of adoption for SMDs (small to medium developers :) ) to the Team System versions of Visual Studio.

In the meantime, will I be using the current set of cloud services?  Absolutely, both in my production processes as an SMD and for services that my clients will use.  And, I am doing this for the the reasons Rinat has outlined!

Monday, 15 December 2008

Double Click to Open Visual Studio Solutions in Vista/2008

For a while I have been running Visual Studio under Vista (x32) and now I’m using Workstation 2008 (very happily too!).   I have UAC on, but have a policy setting to automatically elevate without showing a prompt.  (I absolutely can’t live with the dialogs…see here and here for more info).

I have also Visual Studio set to run as administrator, and that’s where the problem starts: I have not been able to open solution files by double clicking them. 

I am very grateful to “Sajeev Prasad / Arun Arcot” response to this post for the solution.

Basically, set both IDE and the loader (%programfiles%\Common Files\Microsoft Shared\MSEnv\VSLauncher.exe) to run as administrator and you can then double click to open solutions.

Thanks Sajeev and Arun!

ReSharper Plugins

I’ve been using ReSharper since it’s first EAP release (late 2003 or early 2004, if I am right) and quite simply would not want to code without it.

ReSharper is a platform that can be easily extended and it is worth noting that there are a number of excellent plugins available that to make your ReSharper experience even better.

I mentioned Scout in an earlier post, but there are plugins for NHibernate, Gallio, xUnit and also for stuff like helping extract resources for internationalisation.

Check here for more details.

XML Editor - Liquid XML Studio

I’ve just started using a great XML editor: Liquid XML Studio.  I used it when creating some XSDs the other day.  It’s really easy to use, and has a great graphical interface too. 

The thing I really really like is the feature to generate an instance of the schema.  The only other tool I’m aware of that does this is the BizTalk schema editor – but that’s a bit more of a heavyweight tool than I usually need!

It also has Visual Studio integration (with the visual editor), XPath expression builder, documentation generation and a web service browser.  It’s not cheap, but there is a free feature limited Community Edition.  There’s also the high end Developer Edition that adds a load of muscle for people working with more complex schemas, such as the OASIS schemas.

Joyful Reflections - ReSharper Scout

I’ve just found an excellent ReSharper plugin called Scout.  This lovely little beast will open Reflector when you choose Go to Declaration.  The thing I really love is that Scout also takes care of loading the appropriate assembly in Reflector.  I previously had to load the assembly in Reflector before I could browse it, which took time.  Scout makes this process seamless.

All you have to do is right click and select Go to Declaration:

Selecting the "Go to Declaration" menu item

Then you get taken to the item in Reflector and the correct assembly is loaded:

reflector

Scout will also take you to the Dotnet source code – but I haven’t got around to that yet!  You can find lots of other ReSharper plugin goodness here.