Sign In| Join
Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
0 Points
3 Posts
Apr 25, 2012 11:59 AM|LINK
Trying to access the current URL as below succeeds in IIS host:
var uri = this.Url.Route(null, new { id = value.Id });
but throws 'ArgumentNullException' exception with self-host. The error message is: 'Value cannot be null. Parameter name: name' and stack trace:
at System.Web.Http.HttpRouteCollection.GetVirtualPath(HttpControllerContext controllerContext, String name, IDictionary`2 values) at System.Web.Http.Routing.UrlHelper.GetHttpRouteHelper(HttpControllerContext controllerContext, String routeName, IDictionary`2 routeValues) at System.Web.Http.Routing.UrlHelper.GetHttpRouteHelper(HttpControllerContext controllerContext, String routeName, Object routeValues) at System.Web.Http.Routing.UrlHelper.Route(String routeName, Object routeValues) at MyProj.Services.DataService.Controllers.MessageController.Post(MessageDto value) in C:\...\MessageController.cs:line 93 at lambda_method(Closure , Object , Object[] ) at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ActionExecutor.Execute(Object instance, Object[] arguments) at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.Execute(HttpControllerContext controllerContext, IDictionary`2 arguments) at System.Web.Http.Controllers.ApiControllerActionInvoker.<>c__DisplayClass2.<InvokeActionAsync>b__0() at System.Threading.Tasks.TaskHelpers.RunSynchronously[TResult](Func`1 func, CancellationToken cancellationToken)
Everything else seems to work otherwise and all routes are correctly set-up. Is this a bug? Any ideas?
soygul
0 Points
3 Posts
Self-host this.Url.Route
Apr 25, 2012 11:59 AM|LINK
Trying to access the current URL as below succeeds in IIS host:
var uri = this.Url.Route(null, new { id = value.Id });but throws 'ArgumentNullException' exception with self-host. The error message is: 'Value cannot be null. Parameter name: name' and stack trace:
at System.Web.Http.HttpRouteCollection.GetVirtualPath(HttpControllerContext controllerContext, String name, IDictionary`2 values)
at System.Web.Http.Routing.UrlHelper.GetHttpRouteHelper(HttpControllerContext controllerContext, String routeName, IDictionary`2 routeValues)
at System.Web.Http.Routing.UrlHelper.GetHttpRouteHelper(HttpControllerContext controllerContext, String routeName, Object routeValues)
at System.Web.Http.Routing.UrlHelper.Route(String routeName, Object routeValues)
at MyProj.Services.DataService.Controllers.MessageController.Post(MessageDto value) in C:\...\MessageController.cs:line 93
at lambda_method(Closure , Object , Object[] )
at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ActionExecutor.Execute(Object instance, Object[] arguments)
at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.Execute(HttpControllerContext controllerContext, IDictionary`2 arguments)
at System.Web.Http.Controllers.ApiControllerActionInvoker.<>c__DisplayClass2.<InvokeActionAsync>b__0()
at System.Threading.Tasks.TaskHelpers.RunSynchronously[TResult](Func`1 func, CancellationToken cancellationToken)
Everything else seems to work otherwise and all routes are correctly set-up. Is this a bug? Any ideas?