Quantcast
Channel: ASPNETWebStack Issue Tracker Rss Feed
Viewing all articles
Browse latest Browse all 7215

Closed Issue: NullRef with RouteDataValueProvider if route template has catch all parameter [581]

$
0
0
class Program
{
static void Main(string[] args)
{
HttpConfiguration config = new HttpConfiguration();
config.Routes.MapHttpRoute("default", "{controller}({id})/{*pathinfo}");
config.IncludeErrorDetailPolicy = IncludeErrorDetailPolicy.Always;

HttpServer server = new HttpServer(config);
HttpClient client = new HttpClient(server);

HttpResponseMessage response = client.GetAsync("http://localhost/Test(42)").Result;
Console.WriteLine(response.Content.ReadAsStringAsync().Result);
}
}

public class TestController : ApiController
{
public int Get(int id)
{
return id;
}
}

System.NullReferenceException occurred
HResult=-2147467261
Message=Object reference not set to an instance of an object.
Source=System.Web.Http
StackTrace:
at System.Web.Http.ValueProviders.Providers.RouteDataValueProvider.<GetRoutes>d__4.MoveNext()
InnerException:

System.Web.Http.dll!System.Web.Http.ValueProviders.Providers.RouteDataValueProvider.GetRoutes(System.Web.Http.Routing.IHttpRouteData routeData) Line 21 + 0x3f bytes C#
System.Web.Http.dll!System.Web.Http.ValueProviders.Providers.NameValuePairsValueProvider.InitializeValues(System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<string,string>> nameValuePairs) Line 54 + 0x165 bytes C#
System.Web.Http.dll!System.Web.Http.ValueProviders.Providers.NameValuePairsValueProvider..ctor.AnonymousMethod__4() Line 34 + 0x1a bytes C#
mscorlib.dll!System.Lazy<System.Collections.Generic.Dictionary<string,object>>.CreateValue() + 0xb5 bytes
mscorlib.dll!System.Lazy<System.Collections.Generic.Dictionary<string,object>>.LazyInitValue() + 0x99 bytes
mscorlib.dll!System.Lazy<System.Collections.Generic.Dictionary<string,object>>.Value.get() + 0x4c bytes
System.Web.Http.dll!System.Web.Http.ValueProviders.Providers.NameValuePairsValueProvider.GetValue(string key) Line 104 + 0xd bytes C#
System.Web.Http.dll!System.Web.Http.ValueProviders.Providers.CompositeValueProvider.GetValue(string key) Line 38 + 0xc bytes C#
System.Web.Http.dll!System.Web.Http.ModelBinding.Binders.TypeConverterModelBinder.BindModel(System.Web.Http.Controllers.HttpActionContext actionContext, System.Web.Http.ModelBinding.ModelBindingContext bindingContext) Line 19 + 0x26 bytes C#
System.Web.Http.dll!System.Web.Http.Controllers.HttpActionContextExtensions.Bind(System.Web.Http.Controllers.HttpActionContext actionContext, System.Web.Http.ModelBinding.ModelBindingContext bindingContext, System.Collections.Generic.IEnumerable<System.Web.Http.ModelBinding.IModelBinder> binders) Line 163 + 0xf bytes C#
System.Web.Http.dll!System.Web.Http.ModelBinding.Binders.CompositeModelBinder.TryBind(System.Web.Http.Controllers.HttpActionContext actionContext, System.Web.Http.ModelBinding.ModelBindingContext bindingContext) Line 68 + 0x27 bytes C#
System.Web.Http.dll!System.Web.Http.ModelBinding.Binders.CompositeModelBinder.BindModel(System.Web.Http.Controllers.HttpActionContext actionContext, System.Web.Http.ModelBinding.ModelBindingContext bindingContext) Line 38 + 0xf bytes C#
System.Web.Http.dll!System.Web.Http.ModelBinding.ModelBinderParameterBinding.ExecuteBindingAsync(System.Web.Http.Metadata.ModelMetadataProvider metadataProvider, System.Web.Http.Controllers.HttpActionContext actionContext, System.Threading.CancellationToken cancellationToken) Line 57 + 0x18 bytes C#


Comments: Verified.

Viewing all articles
Browse latest Browse all 7215

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>