tags:

views:

999

answers:

5

Hi There,

I have downloaded Storefront asp.net mvc application. When I try to run the application, I get following exception:

ArgumentNullException - Value cannot be null. Parameter name: httpContext

I just don't understand it. How do I fix this error?

Thanks

-Hitesh

A: 

This is sort of odd. The HttpContext houses things such as request and response, cache, cookies, etc. If you are running the project from the perspective of a web site it generally would not be null. Is this error coming up when referencing it in the global? It is possible that you are trying to get to it before it exists in the requests life cycle. Can you post more of the error?

Andrew Siemer
I downloaded the source code, opened in Visual Studio 2008, build the solution successfully, ran the project, and it threw the exception at this line in Site.Master page : <%Html.RenderAction<PersonalizationController>(x => x.Summary());%>. Here is the top line in StackTrace - at System.Web.Routing.RequestContext..ctor(HttpContextBase httpContext, RouteData routeData) and the Exception Message: Value cannot be null Parameter name:httpContext.
Hitesh
A: 

Make sure you're getting the latest source code Kona. PersonalizationController isn't part of the current codebase.

Todd Smith
How do i get the latest source code Kona? I mean How can I download it? Do I really need it for this Storefront application and to resolve the error I am getting?
Hitesh
A: 

I also get this error because of using StructureMapControllerFactory instead of DefaultControllerFactory.

What might be the reason for this error ?

Note: i am not trying to build StoreFront, i am trying on my own sample project.

Thanks for your time.

Barbaros Alp
A: 

I am also getting the same error when trying to run the StoreFront.

Server Error in '/' Application.

Value cannot be null. Parameter name: httpContext 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.ArgumentNullException: Value cannot be null. Parameter name: httpContext

Source Error:

Line 18: Line 19: Line 20: <%Html.RenderAction(x => x.Summary());%> Line 21: Line 22:

Source File: c:\Users\Desktop\MVCStore_Preview1A\MVCStore_Preview1A\Commerce.Web\App\Views\Shared\Site.Master Line: 20

leela
A: 

can someone help me in fixing this error?

Harpreet