Why am I Getting Sehexception When Calling Roleenvironment.Getconfigurationsettingvalue("Mykey")

Why am I getting SEHException when calling RoleEnvironment.GetConfigurationSettingValue(MYKEY)?

You will get the SEHException if you attempt to access RoleEnvironment if you're not running in the dev fabric or Azure fabric. I believe you're inadvertently running your website under the asp.net development server, meaning you're not in the dev fabric (I've confirmed that this will throw an SEHException). In other words, you've either set your website project as the startup project, or you've right-clicked it and told it to run.

You must set the cloud project itself as the startup project, which will then show your website running on port 81 by default. The cloud project is the project that has, as its members, all of your role definitions. You can look at your browser's URL bar and easily tell if you're running in the asp.net dev server, because you'll be on some random port number instead of port 81.

You should make sure you're running in the dev fabric or Azure fabric by checking RoleEnvironment.IsAvailable. If that's true, you're safe to call anything in RoleEnvironment. If it's false, you're not running within the fabric.

MVC System.Runtime.InteropServices.SEHException When run on LocalHost

The problem was the Azure Caching. Has soon has i disabled chaching it started to work (had to run project on debug to start the azure emulator servive either way, but it works now)

Unit Testing Code for Azure

As far as I'm aware there is no built in way in the testing framework for testing which version of the config settings you should be using. I'm using a wrapper class like the one you describe (which I'm sure you already know is simple to write), but mainly so that we can run our websites outside of the dev fabric.



Related Topics



Leave a reply



Submit