Don't miss out Virtual Happy Hour this Friday (April 26).

Try our conversational search powered by Generative AI!

Cannot resolve dependencies...

Vote:
 

I have been handed down a project, where previous owner has upgraded the environment from CMS 5 to CMS 6R2. I have checked out the code from the TFS. I had to add EPiServer.Framework manually in the references. When try to start the project and get the folowing error:

Server Error in '/' Application.


Cannot resolve dependencies for the following module(s)
EPiServer.Web.InitializationModule
EPiServer.Web.InitializationModule
EPiServer.Web.InitializationModule

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: Cannot resolve dependencies for the following module(s)
EPiServer.Web.InitializationModule
EPiServer.Web.InitializationModule
EPiServer.Web.InitializationModule

Source Error:

[No relevant source lines]


Source File: c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\6f598cb5\918a11e5\App_global.asax.navxay8o.0.cs    Line: 0

Stack Trace:

[InvalidOperationException: Cannot resolve dependencies for the following module(s) 
EPiServer.Web.InitializationModule
EPiServer.Web.InitializationModule
EPiServer.Web.InitializationModule]
   EPiServer.Framework.Initialization.InitializationEngine.CreateDependencySortedModules(IEnumerable`1 modules) +445
   EPiServer.Framework.Initialization.InitializationEngine.Initialize(HostType hostType) +116
   EPiServer.Framework.Initialization.InitializationModule.Initialize(HostType hostType) +266
   EPiServer.Framework.Initialization.InitializationModule.FrameworkInitialization(HostType hostType) +92
   EPiServer.Global..ctor() +73
   OBO.Extern.Web.Global..ctor() +44
   ASP.global_asax..ctor() in c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\6f598cb5\918a11e5\App_global.asax.navxay8o.0.cs:0

[TargetInvocationException: Exception has been thrown by the target of an invocation.]
   System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandle& ctor, Boolean& bNeedSecurityCheck) +0
   System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean fillCache) +86
   System.RuntimeType.CreateInstanceImpl(Boolean publicOnly, Boolean skipVisibilityChecks, Boolean fillCache) +230
   System.Activator.CreateInstance(Type type, Boolean nonPublic) +67
   System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes) +1051
   System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes) +111
   System.Web.HttpApplicationFactory.GetSpecialApplicationInstance(IntPtr appContext, HttpContext context) +215
   System.Web.HttpApplicationFactory.GetPipelineApplicationInstance(IntPtr appContext, HttpContext context) +56
   System.Web.Hosting.PipelineRuntime.InitializeApplication(IntPtr appContext) +231

[HttpException (0x80004005): Exception has been thrown by the target of an invocation.]
   System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +8890735
   System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +85
   System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +333



Version Information: Microsoft .NET Framework Version:2.0.50727.3082; ASP.NET Version:2.0.50727.3082

 

I have Visual Studio 2010 SP1, SQL 2008 and CMS 6R2 installed in the environment. I have no problem to start/run a new project with the same environment configuration. I have tried to run it on Windows XP SP3, Windows 2008 R2, and Windows 2003 SP2. On all three OS i have same error.


Any help is appricated...

#54163
Oct 04, 2011 15:09
Vote:
 

I would guess there is some version mismatch when you run the site. This can be either because your project has a hard reference to a faulty version of one of the assemblies (the EPiServer.Framework you added is a suspect) or that your web.config lacks assembly redirects which could take care of such a version conflict.

Compare your working projects of the same version to this project. First, compare the assembly redirects in web.config so that they point to the same versions as in the working project. If still no luck, check the references of the project and compare it to the working projects - are any files added with specific version etc. Match the working project. You can open the .csproj files and compare the reference includes perhaps in a simpler way than by doing it in visual studio.

Another approach is to launch the Assembly Binding Log Viewer (fuslogvw) and check for binding errors (though in my experience it's easier said than done to work with that tool).

#54168
Oct 04, 2011 15:54
Vote:
 

For some reason all the dlls were not copied to the build dir "/bin". I had to manully copy all the EPi dlls from a working project in order to get it working. And cause EPiServer.Framework.dll is in the build dir, therefor there is no need to manually add Framework as the reference in the VS project.

#54201
Oct 05, 2011 10:08
Vote:
 

They are never copied to the bin dir if they are not added as references. That goes for all dll:s, not just episerver. That does not mean that you should add loads of dll:s as references. Many developers use a copy task or post-build event to copy the files from a library folder to bin when building.

#54203
Oct 05, 2011 10:22
Vote:
 

Hi, did you manage to fix the problem?

#54861
Nov 07, 2011 17:50
Vote:
 

Sorry for stealing this thread but I have a similar problem:

<code>

[CompositionException: The composition produced a single composition error. The root cause is provided below. Review the CompositionException.Errors property for more detailed information.

1) The export 'EPiServer.Research.iPhoneExample.iPhoneGadgetsInitializer (ContractName="EPiServer.Framework.IInitializableModule")' is not assignable to type 'EPiServer.Framework.IInitializableModule'.

Resulting in: Cannot set import 'EPiServer.Framework.Initialization.InitializationEngine.Modules (ContractName="EPiServer.Framework.IInitializableModule")' on part 'EPiServer.Framework.Initialization.InitializationEngine'.
Element: EPiServer.Framework.Initialization.InitializationEngine.Modules (ContractName="EPiServer.Framework.IInitializableModule") -->  EPiServer.Framework.Initialization.InitializationEngine
]
   System.ComponentModel.Composition.CompositionResult.ThrowOnErrors(AtomicComposition atomicComposition) +114
   System.ComponentModel.Composition.CompositionResult.ThrowOnErrors() +31
   System.ComponentModel.Composition.Hosting.ComposablePartExportProvider.Compose(CompositionBatch batch) +1470
   System.ComponentModel.Composition.Hosting.CompositionContainer.Compose(CompositionBatch batch) +73
   System.ComponentModel.Composition.AttributedModelServices.ComposeParts(CompositionContainer container, Object[] attributedParts) +284
   EPiServer.Framework.Initialization.InitializationModule.Initialize(HostType hostType) +147
   EPiServer.Framework.Initialization.InitializationModule.FrameworkInitialization(HostType hostType) +68
   EPiServer.Global..ctor() +54
   EPiServer.Templates.Global..ctor() +4
   ASP.global_asax..ctor() in c:\Windows\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\54e243d5\24ea87bf\App_global.asax.c8ny1yl1.0.cs:0

[TargetInvocationException: Exception has been thrown by the target of an invocation.]
   System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandle& ctor, Boolean& bNeedSecurityCheck) +0
   System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean fillCache) +86
   System.RuntimeType.CreateInstanceImpl(Boolean publicOnly, Boolean skipVisibilityChecks, Boolean fillCache) +230
   System.Activator.CreateInstance(Type type, Boolean nonPublic) +67
   System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes) +1051
   System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes) +111
   System.Web.HttpApplicationFactory.GetSpecialApplicationInstance(IntPtr appContext, HttpContext context) +215
   System.Web.HttpApplicationFactory.GetPipelineApplicationInstance(IntPtr appContext, HttpContext context) +56
   System.Web.Hosting.PipelineRuntime.InitializeApplication(IntPtr appContext) +231

[HttpException (0x80004005): Exception has been thrown by the target of an invocation.]
   System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +8901019
   System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +85
   System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +333

 

</code>

This after upgrading our stageing enviroment.

I've copied all episerver dlls into the bin folder.

 

Thanks in advance.


 

#54892
Nov 08, 2011 15:38
Vote:
 

Just noticed, EPiServer has NuGet repo with EPiServer Core in it. Maybe adding the depandencies via nuget can help.

#55168
Nov 21, 2011 8:37
This thread is locked and should be used for reference only. Please use the Episerver CMS 7 and earlier versions forum to open new discussions.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.