How to start ASP.Net State Service in Azure

2019-06-07 09:08发布

While deploying my application in azure i got this error when a session variable is used

enter image description here

I know this error is due to ASP.Net state server mode. I started the service in my local PC but how to start this service in Azure environment?

1条回答
劫难
2楼-- · 2019-06-07 09:55

You can use a start up task to spin up the State Service (or really any service for that matter). However, I would highly recommend that you do not use the session state service. I'd recommend looking at the In Role Windows Azure Cache or the Windows Azure Cache Service (Preview) for session state.

By using the session service you separate your session concerns from your web servers. It is still in preview, so if that concerns you, look at the In Role cache, which won't cost any more to run and can be distributed across multiple machines. Also, if you think the latency to pull from the cache service will be too high then the InRole cache may turn out to be better for you (you'd have to test to be sure).

查看更多
登录 后发表回答