Edit - Problem solved!
The assembly reference for System.Web.Mvc has not been updated by the upgrade.
Web.config:
Broken:
<dependentAssembly>
<assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="1.0.0.0-4.0.0.0" newVersion="4.0.0.1" />
</dependentAssembly>
Fixed:
<dependentAssembly>
<assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="0.0.0.0-5.1.0.0" newVersion="5.1.0.0" />
</dependentAssembly>
/Edit
I'm running a DNN website + Webshop (Hotcakes) and recently upgraded both [DNN 7.4.2 -> 8.0.3, HCC 1.10.4 Pro -> 03.02.00].
I managed to fix all but one issue:
"System.Reflection.AmbiguousMatchException: The current request for action 'Index' on controller type 'CartController' is ambiguous between the following action methods: System.Web.Mvc.ActionResult IndexPost() on type Hotcakes.Modules.Core.Controllers.CartController System.Web.Mvc.ActionResult Index() on type Hotcakes.Modules.Core.Controllers.CartController
I found various questions, including Routing: The current request for action [...] is ambiguous between the following action methods, but didn't find a solution.
According to what I've learned, this should be fine - same ActionName, one Get, one Post. There's no additional Method called Index or IndexPost. What am I missing? Also, I can't play around with the MapRoutes, since DNN is controlling that -> no Global.asax.cs.
The Action methods:
#region Main Cart Actions
// GET: /Cart/
[NonCacheableResponseFilter]
[HccHttpGet]
public ActionResult Index()
{
var model = IndexSetup();
HandleActionParams();
CheckForQuickAdd();
LoadCart(model);
ValidateOrderCoupons();
CheckFreeItems(model);
if (ModuleContext != null && ModuleContext.Configuration.DesktopModule.ModuleName == "Hotcakes.Cart")
HccApp.AnalyticsService.RegisterEvent(HccApp.CurrentCustomerId, ActionTypes.GoToCart, null);
CheckForStockOnItems(model);
return View(model);
}
// POST: /Cart/
[ActionName("Index")]
[HccHttpPost]
public ActionResult IndexPost()
{
var model = IndexSetup();
LoadCart(model);
var intResult = CartIntegration.Create(HccApp).BeforeProceedToCheckout(HccApp, model);
if (!intResult.IsAborted)
{
if (CheckForStockOnItems(model))
{
ForwardToCheckout(model);
}
}
else
{
FlashWarning(intResult.AbortMessage);
}
return View(model);
}
The view:
namespace Hotcakes.Modules.MiniCart
{
public partial class MiniCartView : HotcakesModuleBase
{
protected override string RenderView()
{
var viewName = Convert.ToString(Settings["View"]);
if (!string.IsNullOrEmpty(viewName))
return MvcRenderingEngine.Render("Cart", "Index");
return MvcRenderingEngine.Render("Cart", "Index", "MiniCart", new {MiniCart = true});
}
}
}
Post attribute:
namespace Hotcakes.Commerce.Extensions
{
[AttributeUsage(AttributeTargets.Method)]
public sealed class HccHttpPostAttribute : ActionMethodSelectorAttribute
{
// Fields
private static readonly AcceptVerbsAttribute _innerAttribute = new AcceptVerbsAttribute(HttpVerbs.Post);
// Methods
public override bool IsValidForRequest(ControllerContext controllerContext, MethodInfo methodInfo)
{
var hccRequestType = (string) controllerContext.RequestContext.RouteData.Values["hccrequesttype"];
if (Factory.CreateHccFormRenderer().VirtualFormUsed && !string.IsNullOrEmpty(hccRequestType))
{
return hccRequestType == "hccpost";
}
return _innerAttribute.IsValidForRequest(controllerContext, methodInfo);
}
}
}