Five New Optimizely Certifications are Here! Validate your expertise and advance your career with our latest certification exams. Click here to find out more
AI OnAI Off
Five New Optimizely Certifications are Here! Validate your expertise and advance your career with our latest certification exams. Click here to find out more
Hi Hannes
I would say ask the add-on developer to remove their call to MapMvcAttributeRoutes(). Since it can only be called once, the add-on consumer should be able to call it.
They might even be able to omit using attribute routing, if it is not truly necessary.
Hello,
In my solution I am using inline constraints like this:
var constraintResolver = new DefaultInlineConstraintResolver(); constraintResolver.ConstraintMap.Add("objectType", typeof(ObjectTypeConstraint)); constraintResolver.ConstraintMap.Add("market", typeof(MarketConstraint)); routes.MapMvcAttributeRoutes(constraintResolver);
And in one of the controllers it looks like this:
[Route("{market:market}/{type:objectType}/{county?}/{municipality?}/{city?}/{mainDistrict?}/{district?}/{streetAddress?}", Name = "Search02")] public async Task<ActionResult> Index(
However, now I am trying to use the nuget addon TedGustaf.Episerver.AdaptiveImages which is in its Initialization is also calling the method MapMvcAttributeRoutes() but without adding the DefaultInlineConstraintResolver().
This leads to this error message:
"The inline constraint resolver of type 'DefaultInlineConstraintResolver' was unable to resolve the following inline constraint: 'objectType'."
Since the addons Initialization is in a "black box", so I cannot remove the method call there, how can i register the DefaultInlineConstraintResolver() without calling the method MapMvcAttributeRoutes() ?