Quantcast
Channel: Active questions tagged nuget-package - Stack Overflow
Viewing all articles
Browse latest Browse all 3170

The inline constraint resolver of type 'DefaultInlineConstraintResolver' was unable to resolve the following inline constraint: 'objectType'

$
0
0

I have an Optimizely 11.20 solution with controllers that use inline route constraints like this:

`[Route("   {market:market}/{type:objectType}/{county?}/{municipality?}/{city?}/{mainDistrict?}/{district?}/{streetAddress?}", Name = "Search02")]

public async Task Index(...`

Where the constrains are registered in Global.asax like this:

`public static void RegisterRoutes(RouteCollection routes)    {        routes.IgnoreRoute("{resource}.axd/{*pathInfo}");        routes.IgnoreRoute("authui/{*pathInfo}");        routes.IgnoreRoute("util/{*pathInfo}");        var constraintResolver = new DefaultInlineConstraintResolver();        constraintResolver.ConstraintMap.Add("objectType", typeof(ObjectTypeConstraint));        constraintResolver.ConstraintMap.Add("market", typeof(MarketConstraint));        routes.MapMvcAttributeRoutes(constraintResolver);    }`

Now I also have a third party nuget package installed: TedGustaf.Episerver.AdaptiveImage.And when that addon initializes I get this error message:

The inline constraint resolver of type 'DefaultInlineConstraintResolver' was unable to resolve the following inline constraint: 'objectType'.

[InvalidOperationException: The inline constraint resolver of type 'DefaultInlineConstraintResolver' was unable to resolve the following inline constraint: 'objectType'.]System.Web.Mvc.Routing.InlineRouteTemplateParser.GetInlineConstraint(Group constraintGroup, Boolean isOptional, IInlineConstraintResolver constraintResolver) +479System.Web.Mvc.Routing.InlineRouteTemplateParser.ParseRouteTemplate(String routeTemplate, IDictionary2 defaults, IDictionary2 constraints, IInlineConstraintResolver constraintResolver) +656System.Web.Mvc.Routing.DirectRouteFactoryContext.CreateBuilder(String template, IInlineConstraintResolver constraintResolver) +195System.Web.Mvc.RouteAttribute.System.Web.Mvc.Routing.IDirectRouteFactory.CreateRoute(DirectRouteFactoryContext context) +39System.Web.Mvc.Routing.DefaultDirectRouteProvider.CreateRouteEntry(String areaPrefix, String controllerPrefix, IDirectRouteFactory factory, IReadOnlyCollection1 actions, IInlineConstraintResolver constraintResolver, Boolean targetIsAction) +112 System.Web.Mvc.Routing.DefaultDirectRouteProvider.CreateRouteEntries(String areaPrefix, String controllerPrefix, IReadOnlyCollection1 factories, IReadOnlyCollection1 actions, IInlineConstraintResolver constraintResolver, Boolean targetIsAction) +201 System.Web.Mvc.Routing.DefaultDirectRouteProvider.GetActionDirectRoutes(ActionDescriptor actionDescriptor, IReadOnlyList1 factories, IInlineConstraintResolver constraintResolver) +154System.Web.Mvc.Routing.DefaultDirectRouteProvider.GetDirectRoutes(ControllerDescriptor controllerDescriptor, IReadOnlyList1 actionDescriptors, IInlineConstraintResolver constraintResolver) +290 System.Web.Mvc.Routing.AttributeRoutingMapper.AddRouteEntries(SubRouteCollection collector, IEnumerable1 controllerTypes, IInlineConstraintResolver constraintResolver, IDirectRouteProvider directRouteProvider) +178System.Web.Mvc.Routing.AttributeRoutingMapper.MapAttributeRoutes(RouteCollection routes, IEnumerable`1 controllerTypes, IInlineConstraintResolver constraintResolver, IDirectRouteProvider directRouteProvider) +101TedGustaf.Episerver.AdaptiveImages.Initialization.AddonInitializationModule.Initialize(InitializationEngine context)+30EPiServer.Framework.Initialization.Internal.ModuleNode.Execute(Action a, String key) +58EPiServer.Framework.Initialization.Internal.ModuleNode.Initialize(InitializationEngine context) +123EPiServer.Framework.Initialization.InitializationEngine.InitializeModules() +257

How can I tell the TedGustaf.Episerver.AdaptiveImages initialization to use the DefaultInlineConstraintResolver that have registered the constraints?

I have tried to register the RouteConfig.RegisterRoutes(RouteTable.Routes); further up in the Application_Start() but that did not help.


Viewing all articles
Browse latest Browse all 3170

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>