I'm running into this problem where our custom shipping calculator doesn't kick in after a deployment. It only starts to calculate shipping after restarting the site in IIS after every deployment (I also clear the cache, delete the temp folders and recycle the app pool). After doing this it works fine, but it's not an ideal solution
The calculator is registered as mentioned in the docs:
[RuntimeLevel(MinLevel = RuntimeLevel.Run)]
public class ServiceComposer : IUserComposer
{
public void Compose(Composition composition)
{
composition.RegisterUnique<IShippingCalculator, MyShippingCalculator>();
}
}
And the implementation is fairly simple. We just call our shipping service:
Shipping Calculator not kicking in
Hey,
I'm running into this problem where our custom shipping calculator doesn't kick in after a deployment. It only starts to calculate shipping after restarting the site in IIS after every deployment (I also clear the cache, delete the temp folders and recycle the app pool). After doing this it works fine, but it's not an ideal solution
The calculator is registered as mentioned in the docs:
And the implementation is fairly simple. We just call our shipping service:
I put some logging in and found just doesn't hit CalculateShippingMethodPrice() and instead just falls back to the default shipping price
This is using Vendr 1.2.10
Any ideas what it could be?
Cheers, Mark V
Hi Mark,
My guess is that you are missing the ComposeAfterAttribute to tell your composer to run after ours and so yours is running first and so getting overridden https://vendr.net/docs/core/1-3-0/key-concepts/dependency-injection/#registering-dependencies
Try adding the attribute and see if that helps.
Matt
Hey,
Yep, that's done it thank you!
Turns out I missed this step
Cheers, Mark V
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.