As a SharePoint developer, I though it was time to branch out and check out some of the new “cloud computing” development – and recently attended a Windows Azure ‘getting started’ training day.
We had some discussion & presentations – and then delved into a lab.
Check out the Windows Azure Platform Training Kit for some great material – labs, SDK, project types, etc.
The development environment is Visual Studio 2010 – working locally – with an “emulator” for the COMPUTE and STORAGE machines – which will be ‘in the cloud’ when deployed to Windows Azure.
My development project was progressing OK – until I got a nasty exception – and simply hit a wall. The lecturer was scratching his head also – and so I thought I’d relay the solution – for other folk, and for my own future reference.
When my project would run – I’d get a .NET ‘yellow’ screen error :
The error was happening when I was trying to read the “configuration” information – which uses the ‘RoleEnvironment’ class libraries – within the GLOBAL.ASAX.CS file.
For some reason – the RoleEnvironment was showing as “unavailable”.
But – when looking at the ‘emulator’ running on my local PC – they’re both running – STORAGE – and COMPUTE.
Even if I stop and re-start – and an IISRESET – still the same problem.
So – I tried shutting Visual Studio – and re-opening – but same problem.
This is a little odd though – showing nothing in the “Compute Emulator” – hhhmmmm.
To cut to the chase, it turns out that I’d done an ASP.NET developer style “oops” – by setting the “startup” project to the ‘WebSite’ – which you’d ordinarily do. I’d chosen the “WebRole” as the startup project :
Once I changed this to be the ‘globe’ project – the configurator one (?) – then all was happy !
And – you can now see the list of projects/executables within the “Compute Emulator” :
So – if you’re getting a ‘yellow screen’ error – and/or problems with the “RoleEnvironment” – then check/change the startup projects – it should look like this (BOLD) :
Hope that helps – and saves you some headaches with DEV’ing inside Visual Studio – w/ Azure.