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

Latest Sitemaps and NotFoundHandler dont work together in .Net6 #61

Closed lanorkin closed 1 year ago

lanorkin commented 1 year ago

Related to https://github.com/Geta/geta-optimizely-sitemaps/issues/60 and https://github.com/Geta/geta-notfoundhandler/issues/52

If we try to use Geta.Optimizely.Sitemaps 3.0.0 and Geta.NotFoundHandler 5.0.0 in Net6 - it won't build

To reproduce (assuming Net6 installed):

dotnet new web
dotnet add package EPiServer.CMS
dotnet add package Geta.Optimizely.Sitemaps
dotnet add package Geta.NotFoundHandler.Admin
dotnet add package Geta.NotFoundHandler.Optimizely
dotnet build

error during build:

error : Two assets found targeting the same path with incompatible asset kinds:  [C:\work\temp\geta6\geta6.csproj]
error : '<..>\packages\geta.optimizely.sitemaps\3.0.0\contentFiles\any\net6.0\wwwroot\css\dashboard.css' with kind 'All' [C:\work\temp\geta6\geta6.csproj]
error : '<..>\packages\geta.notfoundhandler.admin\5.0.0\contentFiles\any\net6.0\wwwroot\css\dashboard.css' with kind 'All' [C:\work\temp\geta6\geta6.csproj]
error : for path 'css/dashboard.css' [C:\work\temp\geta6\geta6.csproj]
marisks commented 1 year ago

@lanorkin How does your csproj look like?

marisks commented 1 year ago

@lanorkin I could reproduce it. You should not install both - Geta.NotFoundHandler.Admin and Geta.NotFoundHandler.Optimizely. Install just Geta.NotFoundHandler.Optimizely which will include Geta.NotFoundHandler.Admin as a dependency.

I will check how to fix this. But it seems related to this: https://github.com/dotnet/aspnetcore/issues/39606 and it will be fixed only in .NET 7.

lanorkin commented 1 year ago

Thanks @marisks by doing this I cannot control specific lib versions; but seems it is working as a work around, so closing it.

goran-sneperger commented 7 months ago

I am experiencing the same issue in .net 7. I have only installed Geta.NotFoundHandler.Optimizely but no matter how I order middleware registration inside Startup.cs as soon as Geta.Optimizely.Sitemaps is present NotFoundHandler doesn't kick in. On top of that no other pages in the CMS structure are available. Is there mandatory way of registering both NotFound and Sitemaps modules in order for them to work together?