Storage scopes cannot be created when _AppStart is executing.

Topics: Installing Orchard
Mar 16, 2011 at 4:10 AM

I downloaded the 1.0.20 zip, extracted the files, opened the project in VS 2010, hit the run button, and got this error:

Storage scopes cannot be created when _AppStart is executing.

[InvalidOperationException: Storage scopes cannot be created when _AppStart is executing.]
   System.Web.WebPages.Scope.AspNetRequestScopeStorageProvider.set_CurrentScope(IDictionary`2 value) +89
   System.Web.WebPages.Scope.ScopeStorage.CreateTransientScope(IDictionary`2 context) +103
   System.Web.WebPages.Scope.ScopeStorage.CreateTransientScope() +73
   System.Web.Mvc.ControllerBase.Execute(RequestContext requestContext) +212
   System.Web.Mvc.ControllerBase.System.Web.Mvc.IController.Execute(RequestContext requestContext) +39
   System.Web.Mvc.<>c__DisplayClassb.<BeginProcessRequest>b__5() +68
   System.Web.Mvc.Async.<>c__DisplayClass1.<MakeVoidDelegate>b__0() +44
   System.Web.Mvc.Async.<>c__DisplayClass8`1.<BeginSynchronous>b__7(IAsyncResult _) +42
   System.Web.Mvc.Async.WrappedAsyncResult`1.End() +141
   System.Web.Mvc.Async.AsyncResultWrapper.End(IAsyncResult asyncResult, Object tag) +54
   System.Web.Mvc.Async.AsyncResultWrapper.End(IAsyncResult asyncResult, Object tag) +40
   System.Web.Mvc.<>c__DisplayClasse.<EndProcessRequest>b__d() +38
   System.Web.Mvc.SecurityUtil.<GetCallInAppTrustThunk>b__0(Action f) +31
   System.Web.Mvc.SecurityUtil.ProcessInApplicationTrust(Action action) +56
   System.Web.Mvc.MvcHandler.EndProcessRequest(IAsyncResult asyncResult) +110
   System.Web.Mvc.MvcHandler.System.Web.IHttpAsyncHandler.EndProcessRequest(IAsyncResult result) +38
   Orchard.Mvc.Routes.HttpAsyncHandler.EndProcessRequest(IAsyncResult result) in d:\TeamCity\Projects\Orchard-1.x\src\Orchard\Mvc\Routes\ShellRoute.cs:155
   System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +8841105
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +184

Shouldn't this work?

Thanks, DanO

 

Coordinator
Mar 16, 2011 at 4:22 AM

Refresh?

Mar 16, 2011 at 2:17 PM

Doesn't seem to work - I've refreshed a number of times, and always get this error.

Coordinator
Mar 16, 2011 at 5:19 PM

If you are going to use VS, can you please try again with the full source code release?

Coordinator
Mar 16, 2011 at 5:42 PM

Renaud is attracting my attention on the stack trace that doesn't contain any Orchard code except for providing the route. Is it possible that you have an old version of MVC or WebPages on this machine?

Mar 16, 2011 at 7:01 PM
Edited Mar 16, 2011 at 7:05 PM
Do I need MVC3 installed? I only have MVC2 on this machine.
I can also try again with the full source code release. Probably won't be able to get to that until this evening.
One other thing that's maybe relavent if there are performance issues with the installation process - the files are stored in a network location (not locally).
Thanks, Dan
Coordinator
Mar 16, 2011 at 7:04 PM

No, you do not need MVC 3 installed. The reason I'm asking is that if you have older versions of MVC 3 installed on the machine, as they would be in theGAC they would take precedence over the copy in bin that comes with Orchard, breaking the application.

Running from a network location might be the reason why this is failing. I'm not sure we support that.

Mar 23, 2011 at 3:05 PM
Bertrand,
I did have a chance to download the full source, and it seems to work fine with VS 2010. However, it is prohibitively slow when running from a UNC location. This isn't a problem with other sites, so not sure why it is an issue with Orchard. If I run the code locally, it performs fine.
We have a somewhat unique dev environment using Citrix virtual machines that share a common "gold" image, and we also use a shared IIS config and shared hosts file. It makes maintaining our development environment really easy, and has worked well with all of our projects. Just seems to be Orchard that performs poorly over the network.
Given our development environment, this issue is a "deal breaker" for us adopting Orchard right now. We are enthusiastic about the project, so hope this is something you will address soon.
Thanks, Dan
On Wed, Mar 16, 2011 at 2:04 PM, bertrandleroy <notifications@codeplex.com> wrote:

From: bertrandleroy

No, you do not need MVC 3 installed. The reason I'm asking is that if you have older versions of MVC 3 installed on the machine, as they would be in theGAC they would take precedence over the copy in bin that comes with Orchard, breaking the application.

Running from a network location might be the reason why this is failing. I'm not sure we support that.

Read the full discussion online.

To add a post to this discussion, reply to this email (orchard@discussions.codeplex.com)

To start a new discussion for this project, email orchard@discussions.codeplex.com

You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe on CodePlex.com.

Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at CodePlex.com


Coordinator
Mar 23, 2011 at 5:18 PM

I'm forwarding this around. We'll get back to you.

Mar 23, 2011 at 5:19 PM
Thanks!

On Wed, Mar 23, 2011 at 12:18 PM, bertrandleroy <notifications@codeplex.com> wrote:

From: bertrandleroy

I'm forwarding this around. We'll get back to you.

Read the full discussion online.

To add a post to this discussion, reply to this email (orchard@discussions.codeplex.com)

To start a new discussion for this project, email orchard@discussions.codeplex.com

You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe on CodePlex.com.

Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at CodePlex.com


Coordinator
Mar 23, 2011 at 6:06 PM

So this is just your dev environment, right? There are some similar scenarios for production environments but the mitigations would be different.

Mar 23, 2011 at 7:53 PM
This is just our local dev environment. Our local IIS sites point to UNC paths. If I save the code to my hard drive, and point the IIS site there, the performance improves dramatically. I would not expect this to be an issue on our dev or prod servers, since the code would live right on the machine.
Thanks, Dan

On Wed, Mar 23, 2011 at 1:06 PM, bertrandleroy <notifications@codeplex.com> wrote:

From: bertrandleroy

So this is just your dev environment, right? There are some similar scenarios for production environments but the mitigations would be different.

Read the full discussion online.

To add a post to this discussion, reply to this email (orchard@discussions.codeplex.com)

To start a new discussion for this project, email orchard@discussions.codeplex.com

You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe on CodePlex.com.

Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at CodePlex.com


Coordinator
Mar 23, 2011 at 8:39 PM

Yes, I'm sorry but pointing multiple dev machines to the same network file system is never going to work well. The compilation is quite a heavy process and doing it on the network is going to present a lot of nasty challenges. Beyond very poor performance, you'll get sharing issues every time two developers try to compile at the same time. I'm also suspecting actually running the application is going to cause all kinds of FAIL.

This setup is not only atypical, it also sounds like a bad idea, especially as distributed version control systems such as Mercurial make it trivial to have a central clone of the repository for your organization, and each developer can in turn clone that locally to their machine.

So I apologize for the mismatch but I don't think it would make a lot of sense for us to spend resources on fixing a problem that is going to be limited to very exotic developement setups.

Mar 23, 2011 at 8:52 PM
Bertrand,
Sorry - I think you misunderstood. We are not pointing to the same UNC path, we are each pointing to our own folder.
You should be able to reproduce the issue by simply putting the source code in a network location, and pointing a local iis site at the UNC path. I don't think there is anything more to it than that. I believe this a supported configuration for IIS, and not particularly exotic. We have a couple dozen .NET web app projects running this way, and have not run into any issues with performance.
-Dan
On Wed, Mar 23, 2011 at 3:40 PM, bertrandleroy <notifications@codeplex.com> wrote:

From: bertrandleroy

Yes, I'm sorry but pointing multiple dev machines to the same network file system is never going to work well. The compilation is quite a heavy process and doing it on the network is going to present a lot of nasty challenges. Beyond very poor performance, you'll get sharing issues every time two developers try to compile at the same time. I'm also suspecting actually running the application is going to cause all kinds of FAIL.

This setup is not only atypical, it also sounds like a bad idea, especially as distributed version control systems such as Mercurial make it trivial to have a central clone of the repository for your organization, and each developer can in turn clone that locally to their machine.

So I apologize for the mismatch but I don't think it would make a lot of sense for us to spend resources on fixing a problem that is going to be limited to very exotic developement setups.

Read the full discussion online.

To add a post to this discussion, reply to this email (orchard@discussions.codeplex.com)

To start a new discussion for this project, email orchard@discussions.codeplex.com

You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe on CodePlex.com.

Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at CodePlex.com


Mar 23, 2011 at 8:55 PM
I should add - you will obviously need the site and app pool to run under network credentials if you are pointing to a UNC path.
-Dan
On Wed, Mar 23, 2011 at 3:52 PM, Daniel O'Brien <danielcobrien@gmail.com> wrote:
Bertrand,
Sorry - I think you misunderstood. We are not pointing to the same UNC path, we are each pointing to our own folder.
You should be able to reproduce the issue by simply putting the source code in a network location, and pointing a local iis site at the UNC path. I don't think there is anything more to it than that. I believe this a supported configuration for IIS, and not particularly exotic. We have a couple dozen .NET web app projects running this way, and have not run into any issues with performance.
-Dan
On Wed, Mar 23, 2011 at 3:40 PM, bertrandleroy <notifications@codeplex.com> wrote:

From: bertrandleroy

Yes, I'm sorry but pointing multiple dev machines to the same network file system is never going to work well. The compilation is quite a heavy process and doing it on the network is going to present a lot of nasty challenges. Beyond very poor performance, you'll get sharing issues every time two developers try to compile at the same time. I'm also suspecting actually running the application is going to cause all kinds of FAIL.

This setup is not only atypical, it also sounds like a bad idea, especially as distributed version control systems such as Mercurial make it trivial to have a central clone of the repository for your organization, and each developer can in turn clone that locally to their machine.

So I apologize for the mismatch but I don't think it would make a lot of sense for us to spend resources on fixing a problem that is going to be limited to very exotic developement setups.

Read the full discussion online.

To add a post to this discussion, reply to this email (orchard@discussions.codeplex.com)

To start a new discussion for this project, email orchard@discussions.codeplex.com

You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe on CodePlex.com.

Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at CodePlex.com



Coordinator
Mar 23, 2011 at 8:58 PM

I did misunderstand. Are you seeing poor performance when compiling , or at runtime?

Mar 23, 2011 at 9:11 PM
It's only an issue at runtime. And it's really slow, like 3 minutes per page request. I was surprised to see that I wasn't hitting a time out limit, and that the pages actually load consistently if I wait long enough.
In contrast, I would say compilation time is pretty typical for a solution that large (less than 30 seconds).
Thanks, Dan
On Wed, Mar 23, 2011 at 3:58 PM, bertrandleroy <notifications@codeplex.com> wrote:

From: bertrandleroy

I did misunderstand. Are you seeing poor performance when compiling , or at runtime?

Read the full discussion online.

To add a post to this discussion, reply to this email (orchard@discussions.codeplex.com)

To start a new discussion for this project, email orchard@discussions.codeplex.com

You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe on CodePlex.com.

Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at CodePlex.com


Coordinator
Mar 23, 2011 at 9:13 PM

I see. So then you are pretty much in the same situation as a web hoster. Are you using SQL CE or the full SQL Server. If you are on CE, can you try to switch to the full SQL Server on one of these machines?

Mar 23, 2011 at 9:21 PM
We're running a full version of SQL Server (2008 R2) on a separate server in the network. Are you not able to reproduce?
Thanks, Dan
On Wed, Mar 23, 2011 at 4:13 PM, bertrandleroy <notifications@codeplex.com> wrote:

From: bertrandleroy

I see. So then you are pretty much in the same situation as a web hoster. Are you using SQL CE or the full SQL Server. If you are on CE, can you try to switch to the full SQL Server on one of these machines?

Read the full discussion online.

To add a post to this discussion, reply to this email (orchard@discussions.codeplex.com)

To start a new discussion for this project, email orchard@discussions.codeplex.com

You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe on CodePlex.com.

Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at CodePlex.com


Coordinator
Mar 23, 2011 at 9:54 PM

Well, I can't possibly reproduce every single thing that shows up on forums, it's more efficient to try to rule out the known causes first, I hope you'll understand.

Are you seeing bad performance only on the first hit (cold start) or on all hits?

Mar 23, 2011 at 10:45 PM
It happens on every page view, unfortunately.

Sent from my iPhone

On Mar 23, 2011, at 4:54 PM, "bertrandleroy" <notifications@codeplex.com> wrote:

From: bertrandleroy

Well, I can't possibly reproduce every single thing that shows up on forums, it's more efficient to try to rule out the known causes first, I hope you'll understand.

Are you seeing bad performance only on the first hit (cold start) or on all hits?

Coordinator
Mar 23, 2011 at 11:33 PM

OK then, I've filed a bug so that we can try and reproduce this, and so that we can track it.
http://orchard.codeplex.com/workitem/17534

Coordinator
Mar 23, 2011 at 11:46 PM

Can you try to switch to full trust and see if it makes a difference?