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 :

image

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.

RoleEnvironment.GetConfigurationSettingValue

For some reason – the RoleEnvironment was showing as “unavailable”.

image

But – when looking at the ‘emulator’ running on my local PC – they’re both running – STORAGE – and COMPUTE.

image

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.

image

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 :

image

Once I changed this to be the ‘globe’ project – the configurator one (?) – then all was happy !

image

And – you can now see the list of projects/executables within the “Compute Emulator” :

image

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) :

image

Hope that helps – and saves you some headaches with DEV’ing inside Visual Studio – w/ Azure.

Smile

Advertisements

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

  1. 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

    Like

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

    thanksm.!!

    Like

Leave a Reply

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

WordPress.com Logo

You are commenting using your WordPress.com 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 )

Google+ photo

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

Connecting to %s