Here is my problem.
I have downloaded 2.0 with source code. i can run the application from VS2010. I can build and also publish Nop.Web. I then run the two bat files (prepare and deploy) with no errors. I then copy the nop_2.0 from the 'deployable' folder up to the server. When I did this the first time there was no 'default.aspx' file and someone suggested to add this before publishing (don't know why there is no 'default' page in the first place. Also there is no default page in the 'admin' folder either.) Here is the code-behind:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.Mvc;
namespace Nop.Web
{
public partial class _default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
string originalPath = Request.Path;
HttpContext.Current.RewritePath(Request.ApplicationPath, false);
IHttpHandler httpHandler = new MvcHttpHandler();
httpHandler.ProcessRequest(HttpContext.Current);
HttpContext.Current.RewritePath(originalPath, false);
}
}
}
However when I do this I get this error message:
Server Error in '/' Application.
'HttpContext.SetSessionStateBehavior' can only be invoked before 'HttpApplication.AcquireRequestState' event is raised.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.InvalidOperationException: 'HttpContext.SetSessionStateBehavior' can only be invoked before 'HttpApplication.AcquireRequestState' event is raised.
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[InvalidOperationException: 'HttpContext.SetSessionStateBehavior' can only be invoked before 'HttpApplication.AcquireRequestState' event is raised.]
System.Web.HttpContext.SetSessionStateBehavior(SessionStateBehavior sessionStateBehavior) +4875447
System.Web.Mvc.MvcRouteHandler.GetHttpHandler(RequestContext requestContext) +62
System.Web.Routing.UrlRoutingHandler.ProcessRequest(HttpContextBase httpContext) +153
Nop.Web._default.Page_Load(Object sender, EventArgs e) in C:\NOP2.0\Presentation\Nop.Web\default.aspx.cs:18
System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +25
System.Web.UI.Control.LoadRecursive() +71
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3064
Can someone please help? Older versions of nop could be installed and up and running in less than five minutes but since version 2.0 I see that many people are having trouble. Is there some definitive guide to the installation? Nothing that I have seen so far seems to be able to do the trick!