A critical vulnerability was discovered in React Server Components (Next.js). Our systems remain protected but we advise to update packages to newest version. Learn More.
AI OnAI Off
A critical vulnerability was discovered in React Server Components (Next.js). Our systems remain protected but we advise to update packages to newest version. Learn More.
Use the following code in ConfigureServices
services.AddNotFoundHandler(o =>
{
o.UseSqlServer(Configuration.GetConnectionString("EPiServerDB"));
});
services.AddOptimizelyNotFoundHandler(o =>
{
o.AutomaticRedirectsEnabled = true;
});
And after that use the following code in Configure method
app.UseNotFoundHandler();
app.UseOptimizelyNotFoundHandler();
if (env.IsDevelopment())
{
app.UseDeveloperExceptionPage();
}
And use this in the endpoints
app.UseEndpoints(endpoints =>
{
endpoints.MapRazorPages();
endpoints.MapContent();
});
And please follow the official documentation for this package.
I installed the NuGet
Install-Package Geta.NotFoundHandler.Optimizelyand added the following
services.AddHttpContextAccessor();
services.AddOptimizelyNotFoundHandler(o =>
{
o.AutomaticRedirectsEnabled = true;
});
services.Configure<TinyMceConfiguration>(config =>
{
config.Default()
.AddEpiserverSupport()
.AddPlugin("epi-link code")
.AppendToolbar("epi-link | code");
});
But I get this error when I start the application:
An unhandled exception of type 'System.InvalidOperationException' occurred in System.Private.CoreLib.dll
Unable to resolve service for type 'Geta.NotFoundHandler.Core.Redirects.IRedirectsService' while attempting to activate 'Geta.NotFoundHandler.Optimizely.Core.AutomaticRedirects.DefaultAutomaticRedirectsService'.