Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hi, when I try to run app in localhost, I got an error: System.ArgumentNullException Value cannot be null #79

Closed
ghost opened this issue Jul 2, 2013 · 4 comments

Comments

@ghost
Copy link

ghost commented Jul 2, 2013

When I debug code, I see error ocurred on this block:

                url = url.Substring(0, url.Length -suffix.Length);
                var originalRequest = new ClonedHttpRequest(context.Request, url);
                var originalContext = new ClonedHttpContext(context, originalRequest);

                result = _route.GetRouteData(originalContext);
                if (result != null)
                {
                    // Found the original non-decorated route
                    return result;
                }

result = route.GetRouteData(originalContext) always return null; seems like originalcontext never get route values (and language route value).

My site is running ASP.NET MVC 4, with Entity Framework using IIS Express with Visual Studio 2012

This is error details:

Source code error:

Línea 30: public override string AppRelativeCurrentExecutionFilePath
Línea 31: {
Línea 32: get { return VirtualPathUtility.ToAppRelative(_url); }
Línea 33: }
Línea 34: public override string CurrentExecutionFilePath

Stack Trace:

[ArgumentNullException: Value cannot be null.
Parameter name: virtualPath]
System.Web.VirtualPath.Create(String virtualPath, VirtualPathOptions options) +9800033
System.Web.VirtualPathUtility.ToAppRelative(String virtualPath) +13
i18n.ClonedHttpRequest.get_AppRelativeCurrentExecutionFilePath() in c:\Users\Kellerman\Documents\GitHub\i18n\src\i18n\ClonedHttpRequest.cs:32
System.Web.Routing.Route.GetRouteData(HttpContextBase httpContext) +49
i18n.LanguageRouteDecorator.GetRouteData(HttpContextBase context) in c:\Users\Kellerman\Documents\GitHub\i18n\src\i18n.MVC3\LanguageRouteDecorator.cs:42
System.Web.Routing.RouteCollection.GetRouteData(HttpContextBase httpContext) +233
System.Web.Routing.UrlRoutingModule.PostResolveRequestCache(HttpContextBase context) +60
System.Web.Routing.UrlRoutingModule.OnApplicationPostResolveRequestCache(Object sender, EventArgs e) +82
System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +136
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +69

@StevenDevooght
Copy link

+1

@turquoiseowl
Copy link
Owner

I take it you are using v1.0. That is kind of end of life. Have you looked at the v2 branch?

@ghost
Copy link
Author

ghost commented Jul 3, 2013

@turquoiseowl I don't knew branch v2 exists, but I review it yesterday, after I see your response here. You change localizing mechanism, now httpmodule does work, right? I know this question is out-of-box, but what were the motivation for do that??

@turquoiseowl
Copy link
Owner

Yes, v2 works.

There's a full discussion in Issue #50 about motivation for change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants