Unable to find module

Vote:
 


I am setting up .Net6 Optimizely solution, reusing existing code from .net47.

I can see login/register page, but after login I got such error as below.
- I had EPiServer.Commerce v14.11.0 nuget referenced,
- I put all EPi nugets references in single core project
- EPiServer.Commerce.Shell.dll gets added to modules/_protected directory with correct version
- EPiServer.Commerce.Shell.dll is present in bin/Debug/net6.0 folder with correct version
- cleaned bin/obj folders in all solution projects before build

System.ArgumentException: Unable to find a module by assembly 'EPiServer.Commerce.Shell, Version=14.11.0.0, Culture=neutral, PublicKeyToken=8fe83dea738b45b7' (Parameter 'moduleAssembly')
   at EPiServer.Shell.Paths.ToResource(Assembly moduleAssembly, String moduleRelativeResourcePath)
   at EPiServer.Shell.Paths.ToResource(Type typeInModuleAssembly, String moduleRelativeResourcePath)
   at EPiServer.Commerce.Shell.CommerceUIMenuProvider.GetGlobalMenuItems()
   at EPiServer.Commerce.Shell.CommerceUIMenuProvider.GetMenuItems()
   at EPiServer.Shell.Navigation.MenuAssembler.<>c.<GetMenuItems>b__8_1(IMenuProvider m)
   at System.Linq.Enumerable.SelectManySingleSelectorIterator`2.MoveNext()
   at EPiServer.Shell.Navigation.MenuAssembler.GetMenuItems(String parentPath, Int32 relativeDepth)
   at EPiServer.Shell.Navigation.MenuAssembler.GetMenuHierarchy(String rootPath, Int32 relativeDepth, String selectionPath)
   at EPiServer.Shell.Navigation.MenuAssembler.GetMenuHierarchy(String rootPath, Int32 relativeDepth)
   at EPiServer.Shell.Web.Internal.NavigationService.GetCurrentProduct()
   at EPiServer.Shell.Web.Internal.NavigationService.GetCurrentProductId()
   at EPiServer.Shell.Navigation.MenuHelper.CreateMenuRootElement()
   at EPiServer.Shell.Navigation.MenuHelper.CreatePlatformNavigationMenu()
   at EPiServer.Shell.Navigation.MenuHelper.CreatePlatformNavigationMenu(IHtmlHelper htmlHelper)
   at AspNetCoreGeneratedDocument.CmsUIViews_Views_Shared_Bootstrapper.<ExecuteAsync>b__8_2()
   at Microsoft.AspNetCore.Mvc.Razor.RazorPage.RenderSectionAsyncCore(String sectionName, Boolean required)
   at Microsoft.AspNetCore.Mvc.Razor.RazorPage.RenderSection(String name, Boolean required)
   at Microsoft.AspNetCore.Mvc.Razor.RazorPage.RenderSection(String name)
   at AspNetCoreGeneratedDocument.CmsUIViews_Views_Shared_Sleek.<ExecuteAsync>b__12_1()
   at Microsoft.AspNetCore.Razor.Runtime.TagHelpers.TagHelperExecutionContext.SetOutputContentAsync()
   at AspNetCoreGeneratedDocument.CmsUIViews_Views_Shared_Sleek.ExecuteAsync()
   at Microsoft.AspNetCore.Mvc.Razor.RazorView.RenderPageCoreAsync(IRazorPage page, ViewContext context)
   at Microsoft.AspNetCore.Mvc.Razor.RazorView.RenderPageAsync(IRazorPage page, ViewContext context, Boolean invokeViewStarts)
   at Microsoft.AspNetCore.Mvc.Razor.RazorView.RenderLayoutAsync(ViewContext context, ViewBufferTextWriter bodyWriter)
   at Microsoft.AspNetCore.Mvc.Razor.RazorView.RenderAsync(ViewContext context)
   at Microsoft.AspNetCore.Mvc.ViewFeatures.ViewExecutor.ExecuteAsync(ViewContext viewContext, String contentType, Nullable`1 statusCode)
   at Microsoft.AspNetCore.Mvc.ViewFeatures.ViewExecutor.ExecuteAsync(ViewContext viewContext, String contentType, Nullable`1 statusCode)
   at Microsoft.AspNetCore.Mvc.ViewFeatures.ViewExecutor.ExecuteAsync(ActionContext actionContext, IView view, ViewDataDictionary viewData, ITempDataDictionary tempData, String contentType, Nullable`1 statusCode)
   at Microsoft.AspNetCore.Mvc.ViewFeatures.ViewResultExecutor.ExecuteAsync(ActionContext context, ViewResult result)
   at Microsoft.AspNetCore.Mvc.ViewResult.ExecuteResultAsync(ActionContext context)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeNextResultFilterAsync>g__Awaited|30_0[TFilter,TFilterAsync](ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Rethrow(ResultExecutedContextSealed context)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.ResultNext[TFilter,TFilterAsync](State& next, Scope& scope, Object& state, Boolean& isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.InvokeResultFilters()
--- End of stack trace from previous location ---
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeNextResourceFilter>g__Awaited|25_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Rethrow(ResourceExecutedContextSealed context)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.InvokeFilterPipelineAsync()
--- End of stack trace from previous location ---
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Awaited|17_0(ResourceInvoker invoker, Task task, IDisposable scope)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Awaited|17_0(ResourceInvoker invoker, Task task, IDisposable scope)
   at Microsoft.AspNetCore.Routing.EndpointMiddleware.<Invoke>g__AwaitRequestTask|6_0(Endpoint endpoint, Task requestTask, ILogger logger)
   at Microsoft.AspNetCore.Authorization.Policy.AuthorizationMiddlewareResultHandler.HandleAsync(RequestDelegate next, HttpContext context, AuthorizationPolicy policy, PolicyAuthorizationResult authorizeResult)
   at Microsoft.AspNetCore.Authorization.AuthorizationMiddleware.Invoke(HttpContext context)
   at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context)
   at Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware.Invoke(HttpContext context)

I go through bunch of topics on and off this forum and can't fix it :/


                    
#303808
Jun 20, 2023 10:54
N Kakar - Jun 23, 2023 21:12
The error suggests that the application is unable to find the 'EPiServer.Commerce.Shell' module with the specified version.
Here are some troubleshooting steps that you can check.
* Check that the correct version of 'EPiServer.Commerce.Shell.dll' is referenced and located in the appropriate folder.
* Ensure all necessary assembly references are correctly added to the project.
* Clean the solution, rebuild it, and make sure the DLL is included in the build output.
* Verify file permissions for the DLL and ensure the application has access to it.
* Double-check the file location and consider re-adding the reference or copying the DLL to the correct location.
* Review any custom assembly loading logic or potential conflicts with other assemblies.
If these steps don't resolve the issue, consult the documentation or seek support from EPiServer for assistance.
Vote:
 

Delete EPiServer.Commerce.Shell folder under modules/protected then try reinstalling.

Also check references. In your web project goto dependencies/packages. Make sure they all look loaded.

#303895
Jun 21, 2023 21:24
Vote:
 

Hi,

Just to add if you have a multi-project setup, ensure that you have consolidated the nuget packages.

I do remember on a recent upgrade while the main project was referencing the correct version a warning appearing informing me it was using a different version.

Might be worth checking the version of the dll's in the bin folder also.

Paul

#303931
Jun 22, 2023 8:11
* 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.