Open shaunluttin opened 9 years ago
When did you pull from that branch? I just pushed some changes that should have fixed this issue. I just tried and can't reproduce. Please let me know. Thanks!
I had pulled just before posting the issue.
I can't reproduce the issue. Just to be sure, can you tell me what changeset you're on?
What do you mean? Do you want to SHA?
Yes, or commit message and date would also work.
I saw a very similar error message coming up a bunch yesterday (null problems with HttpContext)
I can tell you that it happens as a result of something after d3ccd74 (when I reset to this commit, error went away)
Here's the full text:
2015-06-10 00:00:02,287 [45] Orchard.WebApi.Filters.UnhandledApiExceptionFilter - Default - An unhandled exception was thrown in an API operation.
http://example.url
Autofac.Core.DependencyResolutionException: An exception was thrown while executing a resolve operation. See the InnerException for details. ---> Object reference not set to an instance of an object. (See inner exception for details.) ---> System.NullReferenceException: Object reference not set to an instance of an object.
at Orchard.Environment.WorkContextAccessor.HttpContextScopeImplementation..ctor(IEnumerable`1 events, ILifetimeScope lifetimeScope, HttpContextBase httpContext, Object workContextKey)
at Orchard.Environment.WorkContextAccessor.CreateWorkContextScope(HttpContextBase httpContext)
at Orchard.Mvc.MvcModule.HttpContextBaseFactory(IComponentContext context)
at Autofac.Builder.RegistrationBuilder.<>c__DisplayClass1`1.<ForDelegate>b__0(IComponentContext c, IEnumerable`1 p)
at Autofac.Core.Activators.Delegate.DelegateActivator.ActivateInstance(IComponentContext context, IEnumerable`1 parameters)
at Autofac.Core.Resolving.InstanceLookup.Activate(IEnumerable`1 parameters)
at Autofac.Core.Resolving.InstanceLookup.Execute()
at Autofac.Core.Resolving.ResolveOperation.GetOrCreateInstance(ISharingLifetimeScope currentOperationScope, IComponentRegistration registration, IEnumerable`1 parameters)
at Autofac.Core.Activators.Reflection.ConstructorParameterBinding.Instantiate()
at Autofac.Core.Activators.Reflection.ReflectionActivator.ActivateInstance(IComponentContext context, IEnumerable`1 parameters)
at Autofac.Core.Resolving.InstanceLookup.Activate(IEnumerable`1 parameters)
at Autofac.Core.Lifetime.LifetimeScope.GetOrCreateAndShare(Guid id, Func`1 creator)
at Autofac.Core.Resolving.InstanceLookup.Execute()
at Autofac.Core.Resolving.ResolveOperation.GetOrCreateInstance(ISharingLifetimeScope currentOperationScope, IComponentRegistration registration, IEnumerable`1 parameters)
at System.Linq.Enumerable.WhereSelectArrayIterator`2.MoveNext()
at System.Linq.Buffer`1..ctor(IEnumerable`1 source)
at System.Linq.Enumerable.ToArray[TSource](IEnumerable`1 source)
at Autofac.Features.Collections.CollectionRegistrationSource.<>c__DisplayClass4.<RegistrationsFor>b__0(IComponentContext c, IEnumerable`1 p)
at Autofac.Core.Activators.Delegate.DelegateActivator.ActivateInstance(IComponentContext context, IEnumerable`1 parameters)
at Autofac.Core.Resolving.InstanceLookup.Activate(IEnumerable`1 parameters)
at Autofac.Core.Resolving.InstanceLookup.Execute()
at Autofac.Core.Resolving.ResolveOperation.GetOrCreateInstance(ISharingLifetimeScope currentOperationScope, IComponentRegistration registration, IEnumerable`1 parameters)
at Autofac.Core.Activators.Delegate.DelegateActivator.ActivateInstance(IComponentContext context, IEnumerable`1 parameters)
at Autofac.Core.Resolving.InstanceLookup.Activate(IEnumerable`1 parameters)
at Autofac.Core.Resolving.InstanceLookup.Execute()
at Autofac.Core.Resolving.ResolveOperation.GetOrCreateInstance(ISharingLifetimeScope currentOperationScope, IComponentRegistration registration, IEnumerable`1 parameters)
at Autofac.Core.Activators.Reflection.ConstructorParameterBinding.Instantiate()
at Autofac.Core.Activators.Reflection.ReflectionActivator.ActivateInstance(IComponentContext context, IEnumerable`1 parameters)
at Autofac.Core.Resolving.InstanceLookup.Activate(IEnumerable`1 parameters)
at Autofac.Core.Lifetime.LifetimeScope.GetOrCreateAndShare(Guid id, Func`1 creator)
at Autofac.Core.Resolving.InstanceLookup.Execute()
at Autofac.Core.Resolving.ResolveOperation.GetOrCreateInstance(ISharingLifetimeScope currentOperationScope, IComponentRegistration registration, IEnumerable`1 parameters)
at System.Linq.Enumerable.WhereSelectArrayIterator`2.MoveNext()
at System.Linq.Buffer`1..ctor(IEnumerable`1 source)
at System.Linq.Enumerable.ToArray[TSource](IEnumerable`1 source)
at Autofac.Features.Collections.CollectionRegistrationSource.<>c__DisplayClass4.<RegistrationsFor>b__0(IComponentContext c, IEnumerable`1 p)
at Autofac.Core.Activators.Delegate.DelegateActivator.ActivateInstance(IComponentContext context, IEnumerable`1 parameters)
at Autofac.Core.Resolving.InstanceLookup.Activate(IEnumerable`1 parameters)
at Autofac.Core.Resolving.InstanceLookup.Execute()
at Autofac.Core.Resolving.ResolveOperation.GetOrCreateInstance(ISharingLifetimeScope currentOperationScope, IComponentRegistration registration, IEnumerable`1 parameters)
at Autofac.Core.Activators.Delegate.DelegateActivator.ActivateInstance(IComponentContext context, IEnumerable`1 parameters)
at Autofac.Core.Resolving.InstanceLookup.Activate(IEnumerable`1 parameters)
at Autofac.Core.Resolving.InstanceLookup.Execute()
at Autofac.Core.Resolving.ResolveOperation.GetOrCreateInstance(ISharingLifetimeScope currentOperationScope, IComponentRegistration registration, IEnumerable`1 parameters)
at Autofac.Core.Resolving.ResolveOperation.Execute(IComponentRegistration registration, IEnumerable`1 parameters)
--- End of inner exception stack trace ---
at Autofac.Core.Resolving.ResolveOperation.Execute(IComponentRegistration registration, IEnumerable`1 parameters)
at Autofac.Features.LazyDependencies.LazyRegistrationSource.<>c__DisplayClass5`1.<>c__DisplayClass7.<CreateLazyRegistration>b__4()
at System.Lazy`1.CreateValue()
at System.Lazy`1.LazyInitValue()
at Orchard.ContentManagement.DefaultContentManager.New(String contentType)
at Orchard.ContentManagement.DefaultContentManager.Get(Int32 id, VersionOptions options, QueryHints hints)
at System.Linq.Enumerable.WhereSelectListIterator`2.MoveNext()
at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
at Orchard.ContentManagement.DefaultContentQuery.ContentQuery`1.Orchard.ContentManagement.IContentQuery<T>.List()
at Orchard.Users.Services.MembershipService.ValidateUser(String userNameOrEmail, String password)
at System.Threading.Tasks.Task`1.InnerInvoke()
at System.Threading.Tasks.Task.Execute()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
at CSM.WebApi.Filters.RequireBasicAuthenticationAttribute.<AuthenticateAsync>d__4.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Web.Http.Controllers.AuthenticationFilterResult.<ExecuteAsync>d__0.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
at System.Web.Http.Controllers.ExceptionFilterResult.<ExecuteAsync>d__0.MoveNext()
I'm seeing this as well. Trying to create a new Orchard instance via Orchard.exe. Orchard/master commmit d1fa8d4.
Initializing Orchard session. (This might take a few seconds...)
A delegate registered to create instances of 'System.Web.HttpContextBase' returned null.
Exception Details: Autofac.Core.DependencyResolutionException: A delegate registered to create instances of 'System.Web.HttpContextBase' returned null.
Stack Trace:
[DependencyResolutionException: A delegate registered to create instances of 'System.Web.HttpContextBase' returned null.] at Autofac.Core.Activators.Delegate.DelegateActivator.ActivateInstance(IComponentContext context, IEnumerable`1 parameters)
at Autofac.Core.Resolving.InstanceLookup.Activate(IEnumerable1 parameters) at Autofac.Core.Resolving.InstanceLookup.Execute() at Autofac.Core.Resolving.ResolveOperation.GetOrCreateInstance(ISharingLifetimeScope currentOperationScope, IComponentRegistration registration, IEnumerable
1 parameters)
at Autofac.Core.Activators.Reflection.ConstructorParameterBinding.Instantiate()
at Autofac.Core.Activators.Reflection.ReflectionActivator.ActivateInstance(IComponentContext context, IEnumerable1 parameters) at Autofac.Core.Resolving.InstanceLookup.Activate(IEnumerable
1 parameters)
at Autofac.Core.Lifetime.LifetimeScope.GetOrCreateAndShare(Guid id, Func1 creator) at Autofac.Core.Resolving.InstanceLookup.Execute() at Autofac.Core.Resolving.ResolveOperation.GetOrCreateInstance(ISharingLifetimeScope currentOperationScope, IComponentRegistration registration, IEnumerable
1 parameters)
at Autofac.Core.Activators.Reflection.ConstructorParameterBinding.Instantiate()
at Autofac.Core.Activators.Reflection.ReflectionActivator.ActivateInstance(IComponentContext context, IEnumerable1 parameters) at Autofac.Core.Resolving.InstanceLookup.Activate(IEnumerable
1 parameters)
at Autofac.Core.Lifetime.LifetimeScope.GetOrCreateAndShare(Guid id, Func1 creator) at Autofac.Core.Resolving.InstanceLookup.Execute() at Autofac.Core.Resolving.ResolveOperation.GetOrCreateInstance(ISharingLifetimeScope currentOperationScope, IComponentRegistration registration, IEnumerable
1 parameters)
at Autofac.Core.Resolving.ResolveOperation.Execute(IComponentRegistration registration, IEnumerable1 parameters) at Autofac.ResolutionExtensions.TryResolveService(IComponentContext context, Service service, IEnumerable
1 parameters, Object& instance)
at Autofac.ResolutionExtensions.ResolveService(IComponentContext context, Service service, IEnumerable1 parameters) at Autofac.ResolutionExtensions.Resolve[TService](IComponentContext context, IEnumerable
1 parameters)
at Orchard.Environment.WorkContextImplementation.Resolve[T]() in C:\inetpub\wwwroot\orchard\orchard\src\Orchard\Environment\WorkContextImplementation.cs:line 19
at Orchard.Environment.WorkContextAccessor.ThreadStaticScopeImplementation.Resolve[TService]() in C:\inetpub\wwwroot\orchard\orchard\src\Orchard\Environment\WorkContextAccessor.cs:line 137
at Orchard.Environment.DefaultOrchardHost.StandaloneEnvironmentWorkContextScopeWrapper.Resolve[TService]() in C:\inetpub\wwwroot\orchard\orchard\src\Orchard\Environment\DefaultOrchardHost.cs:line 355
at Orchard.Setup.Services.SetupService.CreateTenantData(SetupContext context, IWorkContextScope environment) in c:\inetpub\wwwroot\orchard\orchard\src\Orchard.Web\Modules\Orchard.Setup\Services\SetupService.cs:line 197
at Orchard.Setup.Services.SetupService.Setup(SetupContext context) in c:\inetpub\wwwroot\orchard\orchard\src\Orchard.Web\Modules\Orchard.Setup\Services\SetupService.cs:line 186
at Orchard.Setup.Commands.SetupCommand.Setup() in c:\inetpub\wwwroot\orchard\orchard\src\Orchard.Web\Modules\Orchard.Setup\Commands\SetupCommand.cs:line 66
I run into the same issue when i try to create a new module or try to enable Orchard.CodeGeneration option.
On which branch?
I have experienced this related issue on Orchard 1.8.2 release.
Just an FYI pulled the latest version yesterday and this issue appears to still exists when running "help commands" or "feature enable Orchard.CodeGeneration" at least.
From which branch did you pull?
Ah looks like I was pulling from the dev branch. Gonna try the 1.9.x branch...
Ok, let me know. It should work from both branches since 1.9.x was recently pulled into dev.
1.9.x seems to be fine. Thanks!
@sfmskywalker - Could you tell me what change set this fix was applied in
Not off the top of my head, sorry. There have been a lot of change sets dealing with this issue, so if you're looking for a fix, your best shot is pulling the dev branch, or waiting for 1.10 to be released.
OK, is this the same issue from #5306? If so, maybe I can follow the code stream and try to do a hotfix in my codebase.
I'm receiving this error when running
help commands
. It's a pull from OrchardCMS 1.9.x that successfully builds in Visual Studio 2015 on Windows 8.1. Here is the full error message: