首页
学习
活动
专区
工具
TVP
发布
社区首页 >问答首页 >执行_AppStart时无法创建存储作用域

执行_AppStart时无法创建存储作用域
EN

Stack Overflow用户
提问于 2011-03-22 03:52:52
回答 5查看 9.4K关注 0票数 19

使用带有Visual Studio2010(Pre-SP1and with SP1)的ASP.NET MVC3.0和ASP.NET开发服务器时,我每次调试时都会收到错误消息“存储作用域无法在_AppStart执行时创建。”。当我等待几秒钟并刷新浏览器时,它会按预期工作。

  • 这种情况会发生在每个人身上吗?
  • 有没有办法防止这种情况发生?
  • 在生产中是否应该关注这种情况?(IIS6/7主机)

Related work-item #7828 on codeplex没有官方回应。

完整堆栈跟踪:

代码语言:javascript
复制
Server Error in '/' Application.
--------------------------------------------------------------------------------
Storage scopes cannot be created when _AppStart is executing. 
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

Exception Details: System.InvalidOperationException: Storage scopes cannot be created when _AppStart is executing.

Source Error: 

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.  

Stack Trace: 
[InvalidOperationException: Storage scopes cannot be created when _AppStart is executing.]
   System.Web.WebPages.Scope.AspNetRequestScopeStorageProvider.set_CurrentScope(IDictionary`2 value) +83361
   System.Web.WebPages.Scope.ScopeStorage.CreateTransientScope(IDictionary`2 context) +95
   System.Web.WebPages.Scope.ScopeStorage.CreateTransientScope() +76
   System.Web.Mvc.ControllerBase.Execute(RequestContext requestContext) +84
   System.Web.Mvc.ControllerBase.System.Web.Mvc.IController.Execute(RequestContext requestContext) +10
   System.Web.Mvc.<>c__DisplayClassb.<BeginProcessRequest>b__5() +37
   System.Web.Mvc.Async.<>c__DisplayClass1.<MakeVoidDelegate>b__0() +21
   System.Web.Mvc.Async.<>c__DisplayClass8`1.<BeginSynchronous>b__7(IAsyncResult _) +12
   System.Web.Mvc.Async.WrappedAsyncResult`1.End() +62
   System.Web.Mvc.<>c__DisplayClasse.<EndProcessRequest>b__d() +50
   System.Web.Mvc.SecurityUtil.<GetCallInAppTrustThunk>b__0(Action f) +7
   System.Web.Mvc.SecurityUtil.ProcessInApplicationTrust(Action action) +22
   System.Web.Mvc.MvcHandler.EndProcessRequest(IAsyncResult asyncResult) +60
   System.Web.Mvc.MvcHandler.System.Web.IHttpAsyncHandler.EndProcessRequest(IAsyncResult result) +9
   System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +8862381
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +184
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/5382856

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档