4

After i have deployed my ASP.NET WebRole to Azure and looked into the Azure Intellitrace i noticed a lot of RoleEnvironment Exceptions and they are occuring at RoleEnvironment.IsEmulated.

I thought there is something missing in ServiceConfiguration because the next-to-last call in stacktrace is always RoleEnvironment.GetConfigurationSettingValue.

Now i searched after this problem but i found nothing but this link:

http://bretstateham.com/azure-serviceconfiguration-cscfg-changes%E2%80%A6/

But my service configuration is correct. I think the setting ?IsSimulationEnvironment? should be created by Azure, but not in my case because of the exceptions.

And i cannot put the "?IsSimulationEnvironment?" Setting manually in my configuration, because that is not compliant to the xml namespace of the serviceconfiguration.

Has anybody got an idea how to solve this annoying problem?

HeManNew
  • 233
  • 2
  • 10
  • So this is an exception which is caught internally in the SDK, it's not stopping your application from working? – Richard Astbury Oct 01 '12 at 10:58
  • Yes, that's correct - this exception is caught internally in the SDK. But that should be not normal i think, so i thought, that something in my environment is not correct or if anybody has also got found this problem. – HeManNew Oct 02 '12 at 10:00
  • If you are running it locally in the emulator, you should be able to find the config that would have that setting ("?IsSimulationEnvironment?") on the local drive in a place like: "C:\Users\\AppData\Local\dftmp\deployment().config.xml". In that file there is a configuration setting like: – Jason Haley May 10 '13 at 01:44

1 Answers1

0

I think your RoleEnvironment is not available to you yet. ie you are checking RoleEnvironment.IsEmulated before its initialized...

Try this,

while (!RoleEnvironment.IsAvailable)
     continue;//you can sleep sometime then continue
if (RoleEnvironment.IsEmulated)
{
  //Your code here
}
NavaRajan
  • 1,850
  • 1
  • 17
  • 22