Run CMS from Visual Studio

Topics: Troubleshooting
Apr 1, 2011 at 9:06 AM

Hello,

I open site in Visual Studio 2010 Ultimate and try to debug it. This is what I got in browser:

None of the constructors found with policy 'Orchard.Environment.AutofacUtil.DynamicProxy2.ConstructorFinderWrapper' on type 'Orchard.Core.Navigation.Drivers.MenuPartDriver' can be invoked with the available services and parameters:
Constructor 'Void .ctor(Orchard.Security.IAuthorizationService, Orchard.UI.Navigation.INavigationManager, Orchard.IOrchardServices)' parameter resolution failed at parameter 'Orchard.Security.IAuthorizationService authorizationService'.

Source:

_host = OrchardStarter.CreateHost(MvcSingletons);
_host.Initialize(); 

Call Stack:

 

[DependencyResolutionException: None of the constructors found with policy 'Orchard.Environment.AutofacUtil.DynamicProxy2.ConstructorFinderWrapper' on type 'Orchard.Core.Navigation.Drivers.MenuPartDriver' can be invoked with the available services and parameters:
Constructor 'Void .ctor(Orchard.Security.IAuthorizationService, Orchard.UI.Navigation.INavigationManager, Orchard.IOrchardServices)' parameter resolution failed at parameter 'Orchard.Security.IAuthorizationService authorizationService'.]
   Autofac.Core.Activators.Reflection.ReflectionActivator.ActivateInstance(IComponentContext context, IEnumerable`1 parameters) +578
   Autofac.Core.Resolving.ComponentActivation.Activate(IEnumerable`1 parameters) +89
   Autofac.Core.Lifetime.LifetimeScope.GetOrCreateAndShare(Guid id, Func`1 creator) +122
   Autofac.Core.Resolving.ComponentActivation.Execute(IEnumerable`1 parameters) +255
   Autofac.Core.Resolving.ResolveOperation.Resolve(ISharingLifetimeScope activationScope, IComponentRegistration registration, IEnumerable`1 parameters) +246
   System.Linq.WhereSelectArrayIterator`2.MoveNext() +110
   System.Linq.Buffer`1..ctor(IEnumerable`1 source) +488
   System.Linq.Enumerable.ToArray(IEnumerable`1 source) +104
   Autofac.Features.Collections.<>c__DisplayClass4.<RegistrationsFor>b__0(IComponentContext c, IEnumerable`1 p) +197
   Autofac.Core.Activators.Delegate.DelegateActivator.ActivateInstance(IComponentContext context, IEnumerable`1 parameters) +74
   Autofac.Core.Resolving.ComponentActivation.Activate(IEnumerable`1 parameters) +89
   Autofac.Core.Resolving.ComponentActivation.Execute(IEnumerable`1 parameters) +141
   Autofac.Core.Resolving.ResolveOperation.Resolve(ISharingLifetimeScope activationScope, IComponentRegistration registration, IEnumerable`1 parameters) +246
   Autofac.Builder.<>c__DisplayClass1`1.<ForDelegate>b__0(IComponentContext c, IEnumerable`1 p) +15
   Autofac.Core.Activators.Delegate.DelegateActivator.ActivateInstance(IComponentContext context, IEnumerable`1 parameters) +74
   Autofac.Core.Resolving.ComponentActivation.Activate(IEnumerable`1 parameters) +89
   Autofac.Core.Resolving.ComponentActivation.Execute(IEnumerable`1 parameters) +141
   Autofac.Core.Resolving.ResolveOperation.Resolve(ISharingLifetimeScope activationScope, IComponentRegistration registration, IEnumerable`1 parameters) +246
   Autofac.Core.Activators.Reflection.ConstructorParameterBinding.Instantiate() +92
   Autofac.Core.Activators.Reflection.ReflectionActivator.ActivateInstance(IComponentContext context, IEnumerable`1 parameters) +321
   Autofac.Core.Resolving.ComponentActivation.Activate(IEnumerable`1 parameters) +89
   Autofac.Core.Lifetime.LifetimeScope.GetOrCreateAndShare(Guid id, Func`1 creator) +122
   Autofac.Core.Resolving.ComponentActivation.Execute(IEnumerable`1 parameters) +255
   Autofac.Core.Resolving.ResolveOperation.Resolve(ISharingLifetimeScope activationScope, IComponentRegistration registration, IEnumerable`1 parameters) +246
   System.Linq.WhereSelectArrayIterator`2.MoveNext() +110
   System.Linq.Buffer`1..ctor(IEnumerable`1 source) +488
   System.Linq.Enumerable.ToArray(IEnumerable`1 source) +104
   Autofac.Features.Collections.<>c__DisplayClass4.<RegistrationsFor>b__0(IComponentContext c, IEnumerable`1 p) +197
   Autofac.Core.Activators.Delegate.DelegateActivator.ActivateInstance(IComponentContext context, IEnumerable`1 parameters) +74
   Autofac.Core.Resolving.ComponentActivation.Activate(IEnumerable`1 parameters) +89
   Autofac.Core.Resolving.ComponentActivation.Execute(IEnumerable`1 parameters) +141
   Autofac.Core.Resolving.ResolveOperation.Resolve(ISharingLifetimeScope activationScope, IComponentRegistration registration, IEnumerable`1 parameters) +246
   Autofac.Builder.<>c__DisplayClass1`1.<ForDelegate>b__0(IComponentContext c, IEnumerable`1 p) +15
   Autofac.Core.Activators.Delegate.DelegateActivator.ActivateInstance(IComponentContext context, IEnumerable`1 parameters) +74
   Autofac.Core.Resolving.ComponentActivation.Activate(IEnumerable`1 parameters) +89
   Autofac.Core.Resolving.ComponentActivation.Execute(IEnumerable`1 parameters) +141
   Autofac.Core.Resolving.ResolveOperation.Resolve(ISharingLifetimeScope activationScope, IComponentRegistration registration, IEnumerable`1 parameters) +246
   Autofac.Core.Lifetime.LifetimeScope.Resolve(IComponentRegistration registration, IEnumerable`1 parameters) +276
   Autofac.ResolutionExtensions.Resolve(IComponentContext context, Service service, IEnumerable`1 parameters) +221
   Autofac.ResolutionExtensions.Resolve(IComponentContext context, IEnumerable`1 parameters) +117
   Orchard.ContentManagement.DefaultContentManager.New(String contentType) in d:\TeamCity\Projects\Orchard-1.x\src\Orchard\ContentManagement\DefaultContentManager.cs:73
   Orchard.ContentManagement.DefaultContentManager.Get(Int32 id, VersionOptions options) in d:\TeamCity\Projects\Orchard-1.x\src\Orchard\ContentManagement\DefaultContentManager.cs:132
   System.Linq.WhereSelectListIterator`2.MoveNext() +232
   System.Collections.Generic.List`1..ctor(IEnumerable`1 collection) +472
   System.Linq.Enumerable.ToList(IEnumerable`1 source) +80
   Orchard.ContentManagement.ContentQuery`1.Orchard.ContentManagement.IContentQuery<T>.List() in d:\TeamCity\Projects\Orchard-1.x\src\Orchard\ContentManagement\DefaultContentQuery.cs:184
   Orchard.Core.Containers.Services.ContainersPathConstraintUpdater.Refresh() in d:\TeamCity\Projects\Orchard-1.x\src\Orchard.Web\Core\Containers\Services\ContainersPathConstraintUpdater.cs:30

 

And 1 more problem. I installed Multi-level menu module and this is what I get when I try to debug a website from VS2010 with this module enabled:

Error compiling module "Szmyd.Orchard.Modules.Menu" from file "/Orchard.Web/Modules/Szmyd.Orchard.Modules.Menu/Szmyd.Orchard.Modules.Menu.csproj":
The assembly reference 'PS.Library' could not be loaded

Source:

<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>

Source file: /Orchard.Web/Modules/Szmyd.Orchard.Modules.Menu/Szmyd.Orchard.Modules.Menu.csproj

Apr 1, 2011 at 9:28 AM

What's your version - and are you debugging on a full source enlistment (with all the other projects etc.) or just the website?

It's recommended to get the complete source code if you want to debug. Also, Szmyd's menu module has a problem with 1.1 until he makes a new release.