Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DXP Unable to find a module by assembly error #131

Open
nkuebler-nafinc opened this issue Sep 11, 2024 · 0 comments
Open

DXP Unable to find a module by assembly error #131

nkuebler-nafinc opened this issue Sep 11, 2024 · 0 comments

Comments

@nkuebler-nafinc
Copy link

We are receiving the following error in our DXP integration environment when adding the notfound handler to our solution. The error causes the CMS to display a friendly 500 error page and is inaccessible to content authors. The non CMS or visitor portion of the site is unaffected.

We are using the latest (version 5.0.8) of Geta.NotFoundHandler.Admin.dll, Geta.NotFoundHandler.dll, and Geta.NotFoundHandler.Optimizely.dll. We are actually only referencing Geta.NotFoundHandler.Optimizely nuget package and nuget pulls the others in automatically for us.

The NotFoundHandler works locally when run from Visual Studio without issue.

DXP Error Log:
2024-09-11T19:50:43 You are now connected to the log stream...
2024-09-11T19:49:42.1786043Z fail: Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware[1]
2024-09-11T19:49:42.1786945Z An unhandled exception has occurred while executing the request.
2024-09-11T19:49:42.1794764Z System.ArgumentException: Unable to find a module by assembly 'Geta.NotFoundHandler.Optimizely, Version=5.0.8.0, Culture=neutral, PublicKeyToken=null' (Parameter 'moduleAssembly')
2024-09-11T19:49:42.1795306Z at EPiServer.Shell.Paths.ToResource(Assembly moduleAssembly, String moduleRelativeResourcePath)
2024-09-11T19:49:42.180043Z at EPiServer.Shell.Paths.ToResource(Type typeInModuleAssembly, String moduleRelativeResourcePath)
2024-09-11T19:49:42.1800766Z at Geta.NotFoundHandler.Optimizely.MenuProvider.GetMenuItems()

I have verified that the following DLLs are being deployed in the artifact produced by our build pipeline which targets .net8.0:
Geta.NotFoundHandler.Admin.dll
Geta.NotFoundHandler.dll
Geta.NotFoundHandler.Optimizely.dll

I have also verified that modules/_protected/Geta.NotFoundHandler.Optimizely/module.config is being deployed in our artifact as well.

Pertinent Startup.cs code:
From ConfigureServices method:

services.AddNotFoundHandler(o =>
{
o.UseSqlServer(_dbConnectionsString);
o.Logging = LoggerMode.On;
}, policy =>
{
policy.RequireRole(EPiServer.Authorization.Roles.WebAdmins);
});
services.AddOptimizelyNotFoundHandler();

From Configure method:
app.UseNotFoundHandler();
app.UseOptimizelyNotFoundHandler();

Any assistance that could be provided would be appreciated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants