1

I'm trying to integrate MvcMailer in Orhcard 1.6 but I have this error:

'HttpContext.SetSessionStateBehavior' can only be invoked before 'HttpApplication.AcquireRequestState' event is raised.

in file Orchard\Mvc\Routes\ShellRoute.cs line 54

I tried to debug and I found that the error is thrown from:

private void CreateControllerContext() {
            var routeData = RouteTable.Routes.GetRouteData(CurrentHttpContext);
            ControllerContext = new ControllerContext(CurrentHttpContext, routeData, this);
        }

mailerBase.cs of MvcMailer. In a normal mvc 4 application all goes fine.

Can someonehelp me or someone who has already installed successfully?

Thank you..

This post http://orchard.codeplex.com/discussions/406407 as the same problems.. how to resolve?

nicolo
  • 51
  • 1
  • 4

1 Answers1

0

I wound up resolving this problem for myself by doing the following:

  1. Replace the 1.6 versions of ShellRoutes.cs and RoutePublisher.cs in ~/src/Orchard/Mvc/Routes (i.e., Orchard.Framework) with the ShellRoutes.cs and RoutePublisher.cs from the 1.5 version. In my case I just went to CodePlex, picked 1.5 as the version and copy/pasted each file into VS.
  2. Compile/build just Orchard.Framework.
  3. Copy the Orchard.Framework.dll you just compiled/built and place it in the ~/bin folder of your Orchard.Web instance.

You could just do a compare and/or take out the differences, but I just opted for the above because it was quicker.

REMESQ
  • 1,190
  • 2
  • 26
  • 60