On initial warmup after creating a Blog you get lifescope issues with BlogPathConstraintUpdator


Create a Blog.
Restart you Cassini instance.
F5 with exceptions on.

You should end up with this exception:

No scope with a Tag matching 'work' is visible from the scope in which the instance was requested. This generally indicates that a component registered as per-HTTP request is being reqested by a SingleInstance() component (or a similar scenario.) Under the web integration always request dependencies from the DependencyResolver.Current or ILifetimeScopeProvider.RequestLifetime, never from the container itself.


Jetski5822 wrote Sep 30, 2012 at 7:27 PM

Yeah this one happens if you do this anywhere...

public interface IForumPathConstraint : IRouteConstraint, ISingletonDependency {

sebastienros wrote Oct 9, 2012 at 12:21 AM

Fixed in changeset bfd3df1eebb7

anoordende wrote Jan 18, 2013 at 9:58 PM

Even with sebs fix still experienced this issue. Fixed again by wrapping the IBlogService variable in the BlogPathConstraintUpdator class in a Lazy<IBlogService> and amending the class accordingly. Note by fixed I mean the exception has gone away; no further testing done yet.

sfmskywalker wrote Mar 28, 2014 at 1:28 AM

Fixed in changeset 52aff140c4ed735835a9a49675e66a531dceb1d0