session state - Swap between Azure Colated Caching and InProc -


i have setup web roles use colocated caching. problem during development don't want have run emulator time (as quite cumbersome).

running our web applications (not emulated in web role) fails because of azure session state provider:

[invalidoperationexception: role discovery data unavailable]
microsoft.windowsazure.serviceruntime.roleenvironment.get_roles() +171

is possible configure caching use normal inproc when not running in web role , use azure colocated caching when running in web role.

the session state configuration located in web.config, create config override standard web.config transformations local development , when deploy make sure switch config has reference azure caching provider.

http://blogs.msdn.com/b/webdev/archive/2009/05/04/web-deployment-web-config-transformation.aspx

update: adding notes comments below.
can add code prior start of website programatically swap out providers. there ability on web role start (http://blog.elastacloud.com/2011/05/13/azure-howto-programmatically-modify-web-config-on-webrole-startup/) or simple (synchronous) start task. doing work in role onstart or start task remove necessity asp.net site have dependency on azure runtime detect if running in azure or not , config completed before iis website started.


Comments

Popular posts from this blog

html5 - What is breaking my page when printing? -

c# - must be a non-abstract type with a public parameterless constructor in redis -

ajax - PHP/JSON Login script (Twitter style) not setting sessions -