Windows Azure – RoleEnvironment Unavailable (SEHException)

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.


3 thoughts on “Windows Azure – RoleEnvironment Unavailable (SEHException)

  1. Ajay Narang June 17, 2011 / 8:50 pm

    Hi.. I am facing this same problem. I have made the WCF Cloud Project as the start project and my compute emulator is also showing the correct screens. But still the RoleEnvironment is UnAvailable, Kindly help me solve this issue


  2. Halyna November 26, 2011 / 8:44 pm

    Thank you !!! Great help ! 🙂 No kidding…
    My best wishes to you,


  3. lads February 7, 2012 / 1:49 pm

    hi !!
    this doesnt work …. try to hard core the access key , so it won’t go to configuration setting to get account details..!!



Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s