Geta / geta-optimizely-sitemaps

Search engine sitemaps.xml for Optimizely CMS 12 and Commerce 14
Apache License 2.0
10 stars 14 forks source link

DXP environment throwing Unable to find a module by assembly error after updating Version=3.0.0.0 #63

Closed sanjay-katiyar closed 1 year ago

sanjay-katiyar commented 2 years ago

2022-10-25T11:29:28 You are now connected to the log stream... 2022-10-25T11:29:03.121912865Z warn: EPiServer.Shell.Modules.ModuleFinder[0]

2022-10-25T11:29:03.121980965Z The modules finder couldn't find a directory at '~/EPiServer/episerver-telemetry-ui'

2022-10-25T11:29:03.121989866Z warn: EPiServer.Shell.Modules.ModuleFinder[0]

2022-10-25T11:29:03.121995366Z The modules finder couldn't find a directory at '/EPiServer/episerver-telemetry-ui'

2022-10-25T11:29:03.123857392Z warn: EPiServer.Shell.Modules.ModuleFinder[0]

2022-10-25T11:29:03.123883493Z The modules finder couldn't find a directory at '~/EPiServer/Geta.Optimizely.Sitemaps'

2022-10-25T11:29:03.124906407Z warn: EPiServer.Shell.Modules.ModuleFinder[0]

2022-10-25T11:29:03.125031509Z The modules finder couldn't find a directory at '/EPiServer/Geta.Optimizely.Sitemaps'

2022-10-25T11:29:29.707110646Z fail: Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware[1]

2022-10-25T11:29:29.707164547Z An unhandled exception has occurred while executing the request.

2022-10-25T11:29:29.707171447Z System.ArgumentException: Unable to find a module by assembly 'Geta.Optimizely.Sitemaps, Version=3.0.0.0, Culture=neutral, PublicKeyToken=null' (Parameter 'moduleAssembly')

2

JoshuaFolkerts commented 2 years ago

I am running into this as well. 2022-10-25T12:43:44.042793081Z fail: Microsoft.AspNetCore.Server.Kestrel[13]

2022-10-25T12:43:44.043012184Z Connection id "0HMLMGNQT0NLQ", Request id "0HMLMGNQT0NLQ:00000002": An unhandled exception was thrown by the application.

2022-10-25T12:43:44.043020184Z System.ArgumentException: Unable to find a module by assembly 'Geta.Optimizely.Sitemaps, Version=3.0.0.0, Culture=neutral, PublicKeyToken=null' (Parameter 'moduleAssembly')

2022-10-25T12:43:44.043025584Z at EPiServer.Shell.Paths.ToResource(Assembly moduleAssembly, String moduleRelativeResourcePath)

2022-10-25T12:43:44.043030184Z at EPiServer.Shell.Paths.ToResource(Type typeInModuleAssembly, String moduleRelativeResourcePath)

2022-10-25T12:43:44.043035384Z at Geta.Optimizely.Sitemaps.MenuProvider.GetMenuItems()

2022-10-25T12:43:44.043040084Z at EPiServer.Shell.Navigation.MenuAssembler.<>c.b__8_1(IMenuProvider m)

2022-10-25T12:43:44.043045784Z at System.Linq.Enumerable.SelectManySingleSelectorIterator`2.MoveNext()

2022-10-25T12:43:44.043050684Z at EPiServer.Shell.Navigation.MenuAssembler.GetMenuItems(String parentPath, Int32 relativeDepth)

2022-10-25T12:43:44.043055284Z at EPiServer.Shell.Navigation.MenuAssembler.GetMenuHierarchy(String rootPath, Int32 relativeDepth, String selectionPath)

2022-10-25T12:43:44.043061085Z at EPiServer.Shell.Navigation.MenuAssembler.GetMenuHierarchy(String rootPath, Int32 relativeDepth)

2022-10-25T12:43:44.043066285Z at EPiServer.Shell.Web.Internal.NavigationService.GetCurrentProduct()

2022-10-25T12:43:44.043070685Z at EPiServer.Shell.Web.Internal.NavigationService.GetCurrentProductId()

2022-10-25T12:43:44.043075385Z at EPiServer.Shell.Navigation.MenuHelper.CreateMenuRootElement()

2022-10-25T12:43:44.043079885Z at EPiServer.Shell.Navigation.MenuHelper.CreatePlatformNavigationMenu()

2022-10-25T12:43:44.043084585Z at EPiServer.Shell.Navigation.MenuHelper.CreatePlatformNavigationMenu(IHtmlHelper htmlHelper)

2022-10-25T12:43:44.043091985Z at AspNetCoreGeneratedDocument.CmsUIViews_Views_Shared_Bootstrapper.b__7_2()

2022-10-25T12:43:44.043111485Z at Microsoft.AspNetCore.Mvc.Razor.RazorPage.RenderSectionAsyncCore(String sectionName, Boolean required)

2022-10-25T12:43:44.043116485Z at Microsoft.AspNetCore.Mvc.Razor.RazorPage.RenderSection(String name, Boolean required)

2022-10-25T12:43:44.043120985Z at Microsoft.AspNetCore.Mvc.Razor.RazorPage.RenderSection(String name)

2022-10-25T12:43:44.043128386Z at AspNetCoreGeneratedDocument.CmsUIViews_Views_Shared_Sleek.b__12_1()

2022-10-25T12:43:44.043132986Z at Microsoft.AspNetCore.Razor.Runtime.TagHelpers.TagHelperExecutionContext.SetOutputContentAsync()

2022-10-25T12:43:44.043137586Z at AspNetCoreGeneratedDocument.CmsUIViews_Views_Shared_Sleek.ExecuteAsync()

2022-10-25T12:43:44.043144486Z at Microsoft.AspNetCore.Mvc.Razor.RazorView.RenderPageCoreAsync(IRazorPage page, ViewContext context)

2022-10-25T12:43:44.043149586Z at Microsoft.AspNetCore.Mvc.Razor.RazorView.RenderPageAsync(IRazorPage page, ViewContext context, Boolean invokeViewStarts)

2022-10-25T12:43:44.043154086Z at Microsoft.AspNetCore.Mvc.Razor.RazorView.RenderLayoutAsync(ViewContext context, ViewBufferTextWriter bodyWriter)

2022-10-25T12:43:44.043158886Z at Microsoft.AspNetCore.Mvc.Razor.RazorView.RenderAsync(ViewContext context)

2022-10-25T12:43:44.043163286Z at Microsoft.AspNetCore.Mvc.ViewFeatures.ViewExecutor.ExecuteAsync(ViewContext viewContext, String contentType, Nullable`1 statusCode)

2022-10-25T12:43:44.043167786Z at Microsoft.AspNetCore.Mvc.ViewFeatures.ViewExecutor.ExecuteAsync(ViewContext viewContext, String contentType, Nullable`1 statusCode)

2022-10-25T12:43:44.043172286Z at Microsoft.AspNetCore.Mvc.ViewFeatures.ViewExecutor.ExecuteAsync(ActionContext actionContext, IView view, ViewDataDictionary viewData, ITempDataDictionary tempData, String contentType, Nullable`1 statusCode)

2022-10-25T12:43:44.043176586Z at Microsoft.AspNetCore.Mvc.ViewFeatures.ViewResultExecutor.ExecuteAsync(ActionContext context, ViewResult result)

2022-10-25T12:43:44.043180886Z at Microsoft.AspNetCore.Mvc.ViewResult.ExecuteResultAsync(ActionContext context)

2022-10-25T12:43:44.043186586Z at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.g__Logged|22_0(ResourceInvoker invoker, IActionResult result)

2022-10-25T12:43:44.043191386Z at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.g__Awaited|30_0[TFilter,TFilterAsync](ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)

2022-10-25T12:43:44.043196686Z at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Rethrow(ResultExecutedContextSealed context)

2022-10-25T12:43:44.043201887Z at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.ResultNext[TFilter,TFilterAsync](State& next, Scope& scope, Object& state, Boolean& isCompleted)

2022-10-25T12:43:44.043206987Z at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.InvokeResultFilters()

itcotta commented 2 years ago

Same issue here

JoshuaFolkerts commented 2 years ago

I feel bad for Marisks. DXP change causes all this un-needed work

debski commented 2 years ago

I did a workaround by setting the Copy to Output Directory to Copy if newer on the zip in the modules/Geta.Optimizely.SiteMaps folder. Worked for me, as my problem (for whatever reason) was that the new version was omitted from the publish of the solution. But this is just me scrambling to get things working again.

marisks commented 2 years ago

@sanjay-katiyar and @JoshuaFolkerts Do you have both - Geta.Optimizely.Sitemaps and Geta.Optimizely.Sitemaps.Commerce installed?

lanorkin commented 2 years ago

@marisks looks like issue is that modules\_protected\Geta.Optimizely.Sitemaps\Geta.Optimizely.Sitemaps.zip not being copied during publish - if needed steps to reproduce on new project:

dotnet new web
dotnet add package EPiServer.CMS
dotnet add package Geta.Optimizely.Sitemaps
dotnet add package Geta.NotFoundHandler.Optimizely
dotnet build
dotnet publish -p:ErrorOnDuplicatePublishOutputFiles=false

take a look at .\bin\Debug\net6.0\publish\modules\_protected\ folder

Geta.NotFoundHandler.Optimizely exist - OK Geta.Optimizely.Sitemaps not exists - not OK

JoshuaFolkerts commented 2 years ago

@sanjay-katiyar and @JoshuaFolkerts Do you have both - Geta.Optimizely.Sitemaps and Geta.Optimizely.Sitemaps.Commerce installed?

I do not have commerce installed. Just Geta.Optimizely.Sitemaps

sanjay-katiyar commented 2 years ago

@marisks I have installed only Geta.Optimizely.Sitemaps.

marisks commented 2 years ago

@JoshuaFolkerts then that's strange.

@lanorkin thanks! I'll have to reproduce it for myself then. It is my bad that I changed from net5 to net6 :)

JoshuaFolkerts commented 2 years ago

I am running on NET6 right now if that helps?

sanjay-katiyar commented 2 years ago

I am running on NET6 right now if that helps?

I am using net6.0

JoshuaFolkerts commented 2 years ago

I did a workaround by setting the Copy to Output Directory to Copy if newer on the zip in the modules/Geta.Optimizely.SiteMaps folder. Worked for me, as my problem (for whatever reason) was that the new version was omitted from the publish of the solution. But this is just me scrambling to get things working again.

unfortunately, it did not work for me

marisks commented 2 years ago

I found the issue.

One question, does anyone have Commerce installed?

JoshuaFolkerts commented 2 years ago

I found the issue.

One question, does anyone have Commerce installed?

Not I sir

sanjay-katiyar commented 2 years ago

I did a workaround by setting the Copy to Output Directory to Copy if newer on the zip in the modules/Geta.Optimizely.SiteMaps folder. Worked for me, as my problem (for whatever reason) was that the new version was omitted from the publish of the solution. But this is just me scrambling to get things working again.

It works for me.

JoshuaFolkerts commented 2 years ago

Ill have to wait for the updated package

kwijesena commented 2 years ago

Hi @marisks I also have an issue from a client having the same error message. Do we have any plan to fix this or released a fixed version soon? Thanks

marisks commented 2 years ago

I have released the package. Not sure if it is available already. Cannot check now.

JoshuaFolkerts commented 2 years ago

Thanks Maris for your hard work on getting this up and ready. Ill test it now

marisks commented 2 years ago

Does anyone have an issue with sitemaps after the upgrade?

Something like:

System.InvalidOperationException: Duplicate endpoint name 'Sitemap without path' found on 'Geta.Optimizely.Sitemaps.Controllers.GetaSitemapController.Index (Geta.Optimizely.Sitemaps)' and 'Geta.Optimizely.Sitemaps.Controllers.GetaSitemapController.Index (Geta.Optimizely.Sitemaps)'. Endpoint names must be globally unique.
itcotta commented 2 years ago

I've installed the latest version (3.0.2) and deployed to DXP and sadly after logging in into backoffice I'm still having issues. The backoffice page is blank and I'm seeing this error in the logs:

2022-10-26T08:44:43.444429220Z fail: MyProject.Site.Middleware.ErrorHandlingMiddleware[0]

2022-10-26T08:44:43.444485620Z       System.ArgumentException: Unable to find a module by assembly 'Geta.Optimizely.Sitemaps, Version=3.0.2.0, Culture=neutral, PublicKeyToken=null' (Parameter 'moduleAssembly')

2022-10-26T08:44:43.444510320Z          at EPiServer.Shell.Paths.ToResource(Assembly moduleAssembly, String moduleRelativeResourcePath)

2022-10-26T08:44:43.444529720Z          at EPiServer.Shell.Paths.ToResource(Type typeInModuleAssembly, String moduleRelativeResourcePath)

2022-10-26T08:44:43.444535120Z          at Geta.Optimizely.Sitemaps.MenuProvider.GetMenuItems()

2022-10-26T08:44:43.444539220Z          at EPiServer.Shell.Navigation.MenuAssembler.<>c.b__8_1(IMenuProvider m)

2022-10-26T08:44:43.444543921Z          at System.Linq.Enumerable.SelectManySingleSelectorIterator`2.MoveNext()

2022-10-26T08:44:43.444547921Z          at EPiServer.Shell.Navigation.MenuAssembler.GetMenuItems(String parentPath, Int32 relativeDepth)

2022-10-26T08:44:43.444552221Z          at EPiServer.Shell.Navigation.MenuAssembler.GetMenuHierarchy(String rootPath, Int32 relativeDepth, String selectionPath)

2022-10-26T08:44:43.444556421Z          at EPiServer.Shell.Navigation.MenuAssembler.GetMenuHierarchy(String rootPath, Int32 relativeDepth)

2022-10-26T08:44:43.444560421Z          at EPiServer.Shell.Web.Internal.NavigationService.GetCurrentProduct()

2022-10-26T08:44:43.444564421Z          at EPiServer.Shell.Web.Internal.NavigationService.GetCurrentProductId()

2022-10-26T08:44:43.444568321Z          at EPiServer.Shell.Navigation.MenuHelper.CreateMenuRootElement()

2022-10-26T08:44:43.444572321Z          at EPiServer.Shell.Navigation.MenuHelper.CreatePlatformNavigationMenu()

2022-10-26T08:44:43.444577521Z          at EPiServer.Shell.Navigation.MenuHelper.CreatePlatformNavigationMenu(IHtmlHelper htmlHelper)

2022-10-26T08:44:43.444581621Z          at AspNetCoreGeneratedDocument.CmsUIViews_Views_Shared_Bootstrapper.b__7_2()

2022-10-26T08:44:43.444585921Z          at Microsoft.AspNetCore.Mvc.Razor.RazorPage.RenderSectionAsyncCore(String sectionName, Boolean required)

2022-10-26T08:44:43.444590521Z          at Microsoft.AspNetCore.Mvc.Razor.RazorPage.RenderSection(String name, Boolean required)

2022-10-26T08:44:43.444594521Z          at AspNetCoreGeneratedDocument.CmsUIViews_Views_Shared_Sleek.b__12_1()

2022-10-26T08:44:43.444598721Z          at Microsoft.AspNetCore.Razor.Runtime.TagHelpers.TagHelperExecutionContext.SetOutputContentAsync()

2022-10-26T08:44:43.444603821Z          at AspNetCoreGeneratedDocument.CmsUIViews_Views_Shared_Sleek.ExecuteAsync()

2022-10-26T08:44:43.444608321Z          at Microsoft.AspNetCore.Mvc.Razor.RazorView.RenderPageCoreAsync(IRazorPage page, ViewContext context)

2022-10-26T08:44:43.444612521Z          at Microsoft.AspNetCore.Mvc.Razor.RazorView.RenderPageAsync(IRazorPage page, ViewContext context, Boolean invokeViewStarts)

2022-10-26T08:44:43.444616621Z          at Microsoft.AspNetCore.Mvc.Razor.RazorView.RenderLayoutAsync(ViewContext context, ViewBufferTextWriter bodyWriter)

2022-10-26T08:44:43.444620721Z          at Microsoft.AspNetCore.Mvc.Razor.RazorView.RenderAsync(ViewContext context)

2022-10-26T08:44:43.444624721Z          at Microsoft.AspNetCore.Mvc.ViewFeatures.ViewExecutor.ExecuteAsync(ViewContext viewContext, String contentType, Nullable`1 statusCode)

2022-10-26T08:44:43.444628921Z          at Microsoft.AspNetCore.Mvc.ViewFeatures.ViewExecutor.ExecuteAsync(ViewContext viewContext, String contentType, Nullable`1 statusCode)

2022-10-26T08:44:43.444637221Z          at Microsoft.AspNetCore.Mvc.ViewFeatures.ViewExecutor.ExecuteAsync(ActionContext actionContext, IView view, ViewDataDictionary viewData, ITempDataDictionary tempData, String contentType, Nullable`1 statusCode)

2022-10-26T08:44:43.444642021Z          at Microsoft.AspNetCore.Mvc.ViewFeatures.ViewResultExecutor.ExecuteAsync(ActionContext context, ViewResult result)

2022-10-26T08:44:43.444646121Z          at Microsoft.AspNetCore.Mvc.ViewResult.ExecuteResultAsync(ActionContext context)

2022-10-26T08:44:43.444650121Z          at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.g__Logged|22_0(ResourceInvoker invoker, IActionResult result)

2022-10-26T08:44:43.444654521Z          at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.g__Awaited|30_0[TFilter,TFilterAsync](ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)

2022-10-26T08:44:43.444659021Z          at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Rethrow(ResultExecutedContextSealed context)

2022-10-26T08:44:43.444663121Z          at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.ResultNext[TFilter,TFilterAsync](State& next, Scope& scope, Object& state, Boolean& isCompleted)

2022-10-26T08:44:43.444667521Z          at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.InvokeResultFilters()

2022-10-26T08:44:43.444671621Z       --- End of stack trace from previous location ---

2022-10-26T08:44:43.444675921Z          at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.g__Awaited|25_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)

2022-10-26T08:44:43.444680521Z          at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Rethrow(ResourceExecutedContextSealed context)

2022-10-26T08:44:43.444684521Z          at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)

2022-10-26T08:44:43.444688921Z          at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.InvokeFilterPipelineAsync()

2022-10-26T08:44:43.444692821Z       --- End of stack trace from previous location ---

2022-10-26T08:44:43.444696821Z          at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.g__Logged|17_1(ResourceInvoker invoker)

2022-10-26T08:44:43.444701021Z          at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.g__Logged|17_1(ResourceInvoker invoker)

2022-10-26T08:44:43.444705421Z          at Microsoft.AspNetCore.Routing.EndpointMiddleware.g__AwaitRequestTask|6_0(Endpoint endpoint, Task requestTask, ILogger logger)

2022-10-26T08:44:43.444709621Z          at Microsoft.AspNetCore.Session.SessionMiddleware.Invoke(HttpContext context)

2022-10-26T08:44:43.444713621Z          at Microsoft.AspNetCore.Session.SessionMiddleware.Invoke(HttpContext context)

2022-10-26T08:44:43.444717521Z          at Microsoft.AspNetCore.Authorization.Policy.AuthorizationMiddlewareResultHandler.HandleAsync(RequestDelegate next, HttpContext context, AuthorizationPolicy policy, PolicyAuthorizationResult authorizeResult)

2022-10-26T08:44:43.444725222Z          at Microsoft.AspNetCore.Authorization.AuthorizationMiddleware.Invoke(HttpContext context)

2022-10-26T08:44:43.444729722Z          at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context)

2022-10-26T08:44:43.444733722Z          at Mediachase.Commerce.Anonymous.Internal.AnonymousIdMiddleware.Invoke(HttpContext httpContext)

2022-10-26T08:44:43.444737622Z          at Imageflow.Server.ImageflowMiddleware.Invoke(HttpContext context)

2022-10-26T08:44:43.444741522Z          at MyProject.Site.Middleware.CookieBotMiddleware.Invoke(HttpContext context) in D:\a\1\s\src\MyProject.Site\Middleware\CookieBotMiddleware.cs:line 58

2022-10-26T08:44:43.444746422Z          at MyProject.Site.Middleware.IpWhitelistMiddleware.Invoke(HttpContext context) in D:\a\1\s\src\MyProject.Site\Middleware\IpWhitelistMiddleware.cs:line 43

2022-10-26T08:44:43.444750822Z          at MyProject.Site.Middleware.ErrorHandlingMiddleware.Invoke(HttpContext context) in D:\a\1\s\src\MyProject.Site\Middleware\ErrorHandlingMiddleware.cs:line 32
marisks commented 2 years ago

@itcotta Can you check if locally after you build the project, the ZIP file is copied modules\_protected\Geta.Optimizely.Sitemaps? And then try publishing the project into a folder and see if it is copied to the publish folder.

JoshuaFolkerts commented 2 years ago

I am having the same issues as well. I cannot for the life of me get this to work. Here is what i see.

From plugin manager opti-plugin-manager

Edit mode url geta-sitemap-url

Published output folder geta-output-folder

JoshuaFolkerts commented 2 years ago

Does anyone have an issue with sitemaps after the upgrade?

Something like:

System.InvalidOperationException: Duplicate endpoint name 'Sitemap without path' found on 'Geta.Optimizely.Sitemaps.Controll

i haven't seen that issue yet

marisks commented 2 years ago

@JoshuaFolkerts It seems that Optimizely is blocking too much. I'll ask them if they can change it. But do you have modules not found exceptions in the log (the same as @itcotta)? Also, is there a ZIP file in the Geta.Optimizely.Sitemaps folder?

JoshuaFolkerts commented 2 years ago

@marisks There is a zip in the Geta.Optimizely.Sitemaps folder. My fault for selecting the wrong element. I haven't had any issues since the upgrade for not found handler. But it might seem there is a timing on that possibly. Since i am not able to get the site plugin to show in edit mode, it might not see it yet.

itcotta commented 2 years ago

@itcotta Can you check if locally after you build the project, the ZIP file is copied modules\_protected\Geta.Optimizely.Sitemaps? And then try publishing the project into a folder and see if it is copied to the publish folder.

Upon building locally I can see that the _protected\Geta.Optimizely.Sitemaps is generated in the modules folder within my project. However when I run dotnet publish --output "C:\temp" the modules folder that is generated in my C:\temp does not contain a Geta.Optimizely.Sitemaps folder.

I tested selecting Copy to output directory if newer for the Geta.Optimizely.Sitemaps.zip file in my modules folder and this made it so that the zip was created when publishing. However I would prefer not having to commit the zip files into git source control.

ynzenu commented 2 years ago

At the moment, you have to commit the zip file and configure it to Copy if newer. That solved the 'Unable to find a module by assembly' issue for me.

If you still get 'Sorry, you have been blocked', it must still be the older version of the plugin. Make sure you're using the latest version 3.0.2.

svenrog commented 2 years ago
System.InvalidOperationException: Duplicate endpoint name 'Sitemap without path' found on 'Geta.Optimizely.Sitemaps.Controllers.GetaSitemapController.Index (Geta.Optimizely.Sitemaps)' and 'Geta.Optimizely.Sitemaps.Controllers.GetaSitemapController.Index (Geta.Optimizely.Sitemaps)'. Endpoint names must be globally unique.

@marisks This was also caused by the zip file not being copied correctly during build server build. Setting <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> fixed this.

PierreYaksa commented 2 years ago

Hello,

@marisks I did some tests and I confirm since the version 2.1.0 the ZIP file in the Geta.Optimizely.Sitemaps folder is missing when packaging for DXP. Also this issue causes the same startup crash in our DXP env: System.InvalidOperationException: Duplicate endpoint name 'Sitemap without path' found on 'Geta.Optimizely.Sitemaps.Controllers.GetaSitemapController.Index (Geta.Optimizely.Sitemaps)' and 'Geta.Optimizely.Sitemaps.Controllers.GetaSitemapController.Index (Geta.Optimizely.Sitemaps)'. Endpoint names must be globally unique

Do you have idea on how to fix it properly instead of adding the zip files git+CopyToOutputDirectory flag ?

Thank you very much!

Note: I noticed the latest NotFound Handler 5.0.1 doesn't have this issue

GeekInTheNorth commented 2 years ago

Hello @marisks

Is there any further information on resolving this?

I have now for multiple clients performed the above work arounds of forcing the zip file to be included within source control and by adding this to the relevant project:

  <ItemGroup>
    <None Update="modules\_protected\Geta.Optimizely.Sitemaps\Geta.Optimizely.Sitemaps.zip">
      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
    </None>
  </ItemGroup>
marisks commented 2 years ago

Yes, the package is ready for publishing. I will do it soon.

P.S. That was caused by a bug in .NET 6 (I hope fixed in .NET 7)

GeekInTheNorth commented 2 years ago

Awesome news @marisks , thank you for sorting this out.

PierreYaksa commented 2 years ago

Thank you very much @marisks !

marisks commented 2 years ago

I have uploaded a new version, but it is not yet available.

GeekInTheNorth commented 2 years ago

@marisks I can confirm that I've now deployed into DXP and that 3.0.3 fixes the deployment version for me.