Quantcast
Channel: ASP.NET MVC / Web API / Web Pages
Viewing all 7925 articles
Browse latest View live

Commented Unassigned: Unhandled exception is being logged when client cancels requests still happens [2283]

$
0
0
It appears this issue was clsoed for some reason.
http://aspnetwebstack.codeplex.com/workitem/1797

It still happens on 5.2.3 and I posted details back in April of the error it gives. I get these everyday. (I am not using the workaround listed as this was supposed to be fixed)


Comments: I'm getting this too. In my case the Cancellation token is setup within the webapi controller method, and set to cancel after xx seconds. So, the webapi itself if cancelling the request if it's taking too long (we depend on downstream systems so cancel if they are not responding in time), not an external client. When the cancellation token fires, the webapi call is cancelled but the global exception handler (implementation of IExceptionHandler) is not fired at all. We get a 500 and then an unhandled ASP.NET exception in the Even Log. WebApi 5.2.3

Commented Unassigned: Unhandled exception is being logged when client cancels requests still happens [2283]

$
0
0
It appears this issue was clsoed for some reason.
http://aspnetwebstack.codeplex.com/workitem/1797

It still happens on 5.2.3 and I posted details back in April of the error it gives. I get these everyday. (I am not using the workaround listed as this was supposed to be fixed)


Comments: btw, the workaround listed (DelegatingHandler) doesn't work for me as the cancellation is happening from within the method itself after the delgating handler has been called

Created Unassigned: Where the user principal object is set? [2302]

$
0
0
Hi
I am going through the system,web.http.dll and analysing the code for AuthorizeAttribute.cs wherein
IPrincipal user = Thread.CurrentPrincipal is set.
But I didnt understand where exactly the user principal object is set.
I have analyse the HttpServer.cs code where in its setting the User but am not sure.

Commented Unassigned: Where the user principal object is set? [2302]

$
0
0
Hi
I am going through the system,web.http.dll and analysing the code for AuthorizeAttribute.cs wherein
IPrincipal user = Thread.CurrentPrincipal is set.
But I didnt understand where exactly the user principal object is set.
I have analyse the HttpServer.cs code where in its setting the User but am not sure.

Comments: Updated

Edited Unassigned: Where the user principal object is set? [2302]

$
0
0
Hi
I am going through the system.web.http.dll and analysing the code for AuthorizeAttribute.cs wherein
IPrincipal user = Thread.CurrentPrincipal is set.
But I didnt understand where exactly the user principal object is set.
I have analyse the HttpServer.cs code where in its setting the User but am not sure.
Also I want to understand, where the process of token encryption/decryption is happening.

Please share the pointer.

Commented Unassigned: Where the user principal object is set? [2302]

$
0
0
Hi
I am going through the system.web.http.dll and analysing the code for AuthorizeAttribute.cs wherein
IPrincipal user = Thread.CurrentPrincipal is set.
But I didnt understand where exactly the user principal object is set.
I have analyse the HttpServer.cs code where in its setting the User but am not sure.
Also I want to understand, where the process of token encryption/decryption is happening.

Please share the pointer.

Comments: Added few lines

Edited Unassigned: Where the user principal object is set? [2302]

$
0
0
Hi
I am going through the System.Web.Http Project and analysing the code for AuthorizeAttribute.cs wherein
IPrincipal user = Thread.CurrentPrincipal is set.
But I didnt understand where exactly the user principal object is set.
I have analyse the HttpServer.cs code where in its setting the User but am not sure.
Also I want to understand, where the process of token encryption/decryption is happening.

Please share the pointer.

Commented Unassigned: Where the user principal object is set? [2302]

$
0
0
Hi
I am going through the System.Web.Http Project and analysing the code for AuthorizeAttribute.cs wherein
IPrincipal user = Thread.CurrentPrincipal is set.
But I didnt understand where exactly the user principal object is set.
I have analyse the HttpServer.cs code where in its setting the User but am not sure.
Also I want to understand, where the process of token encryption/decryption is happening.

Please share the pointer.

Comments: updated

Reviewed: v5.2.2 (四月 12, 2016)

$
0
0
Rated 5 Stars (out of 5) - good project!!!!

Commented Issue: ViewContext.Writer.Write() inside @helper writes directly to the view instead of the HelperResult [517]

$
0
0
I'm trying to get result of @helper method as variable without writing it to the view (I'm going to do it later after some transformations). And inside this helper I'm using extension to the HtmlHelper which should write some code to the output of the helper.

The simplest code would be like following:

@helper SomeHelper() {
<b>
Html.ViewContext.Writer.Write("Hello world!"); //NOTE: this code is inside of HtmlHelper extension function in the library at nuget.
</b>
}

And I want use this helper later on my page:

@SomeHelper()

And I will get following result:

Hello World
<b></b>

But hello world should be inside of <b> tag, but it is outside.

One possible solution is override Html.ViewContext.Writer.Write with helper's writer.

PS: original problem is described there: https://github.com/danludwig/BeginCollectionItem/issues/3
Comments: I just bumped into this issue. The problem is that inside the @helper the HTML isn't wrote into ViewContext.Writer, but into another TextWriter. You can refer to this TextWriter using the ___razor_helper_writer_ variable, which is accessible only inside the @helper block. So if you write: ``` @{ Layout = null; } @helper MyHelper1() { __razor_helper_writer.Write("<div class=\"helper-1\">"); <div>CONTENT</div> __razor_helper_writer.Write("</div>"); } @helper MyHelper2() { ViewContext.Writer.Write("<div class=\"helper-2\">"); <div>CONTENT</div> ViewContext.Writer.Write("</div>"); } @{ var h1 = MyHelper1().ToHtmlString(); var h2 = MyHelper2().ToHtmlString(); } <div class="main"> @Html.Raw(h1) @Html.Raw(h2) </div> ``` The output is: ``` <div class="helper-2"></div> <div class="main"> <div class="helper-1"> <div>CONTENT</div> </div> <div>CONTENT</div> </div> ``` For the Html.BeginForm method, there is no chance to resolve the issue, because it writes to ViewContext.Writer. Fortunately in my case I was using an "using" construct made by myself (which surrounds the content with auto-generated html, such as the Html.BeginForm does), so I can pass the correct writer to the method. The problem is that this variable isn't documented, so if in the future the developing team decides to change its name or move it away, my view stops working. I searched into the Html object if there is any reference to this writer, but I can't find it. Hope this helps.

Created Unassigned: Need Katana owin source code of vesion 2.0.0.0 [2303]

$
0
0
Hi,
Need Katana owin source code of vesion 2.0.0.0 as I need to extend some fucntionality.
I have latest source code from katana owin site but unable to debug in webapi as most of
the assemblies are referring dll version 2.0.0.0

Please share the link so that I would be easy to debug and understand the code.

Commented Unassigned: Need Katana owin source code of vesion 2.0.0.0 [2303]

$
0
0
Hi,
Need Katana owin source code of vesion 2.0.0.0 as I need to extend some fucntionality.
I have latest source code from katana owin site but unable to debug in webapi as most of
the assemblies are referring dll version 2.0.0.0

Please share the link so that I would be easy to debug and understand the code.

Comments: Added issue

Edited Unassigned: Need Katana owin source code of vesion 2.0.0.0 [2303]

$
0
0
Hi,
Need Katana owin source code of vesion 2.0.0.0 as I need to extend some fucntionality.
I have latest source code from katana owin site but unable to debug in webapi as most of
the assemblies are referring dll version 2.0.0.0

Please share the link so that it would be easy to debug and understand the code.

Commented Unassigned: Need Katana owin source code of vesion 2.0.0.0 [2303]

$
0
0
Hi,
Need Katana owin source code of vesion 2.0.0.0 as I need to extend some fucntionality.
I have latest source code from katana owin site but unable to debug in webapi as most of
the assemblies are referring dll version 2.0.0.0

Please share the link so that it would be easy to debug and understand the code.

Comments: updated

Reviewed: v5.3 RTM (Apr 18, 2016)

$
0
0
Rated 3 Stars (out of 5) - I want to study it .

Created Unassigned: Update Web API client packages to target netstandard [2304]

$
0
0
The next version of asp.net is built on top of the netstandard concept. For nuget to successfully restore Web API client packages. users need to add an import to their project.json files. We want to avoid users having to do this, so we should update the packages to target netstandard.

Commented Issue: CorsMessageHandler does not respect IExceptionHandler [2219]

$
0
0
CorsMessageHandler will swallow all the exceptions that it catches and turn them into 500 response. This behavior does not work with a custom IExceptionHandler implementation where you want a non HttpResponseException to be turned into a different error code.

The code that swallows the exception is at:
```
private static HttpResponseMessage HandleException(HttpRequestMessage request, Exception exception)
{
HttpResponseException httpResponseException = exception as HttpResponseException;

if (httpResponseException != null)
{
return httpResponseException.Response;
}
return request.CreateErrorResponse(HttpStatusCode.InternalServerError, exception);
}
```

Please do not catch the exception in _base.SendAsync_ and allow that exception to bubble up the pipeline.

Comments: Any news about this?

Commented Issue: CorsMessageHandler does not respect IExceptionHandler [2219]

$
0
0
CorsMessageHandler will swallow all the exceptions that it catches and turn them into 500 response. This behavior does not work with a custom IExceptionHandler implementation where you want a non HttpResponseException to be turned into a different error code.

The code that swallows the exception is at:
```
private static HttpResponseMessage HandleException(HttpRequestMessage request, Exception exception)
{
HttpResponseException httpResponseException = exception as HttpResponseException;

if (httpResponseException != null)
{
return httpResponseException.Response;
}
return request.CreateErrorResponse(HttpStatusCode.InternalServerError, exception);
}
```

Please do not catch the exception in _base.SendAsync_ and allow that exception to bubble up the pipeline.

Comments: I think this issue tracker is now dead. Dev are on the core now, on github. https://github.com/aspnet/Home

Created Unassigned: No route data in IHostBufferPolicySelector.UseBufferedInputStream [2305]

$
0
0
I’m trying to use IHostBufferPolicySelector to disable input buffering on a per-route basis, but have been unsuccessful so far.
It looks like route data doesn’t make it into UseBufferedInputStream because the policy selector is sometimes called during route selection, and sometimes after.

If the route is a HostedHttpRoute, and there are no constraints, then the HttpRequestMessage is not created (and thus ConvertRequest and the policy selector are not called) until ProcessRequestAsyncCore is called. At that point, the request context contains the route data.

Otherwise however, the HttpRequestMessage is created (and the policy selector is called) while in GetRouteData. This means that the request context doesn’t yet contain the route data. For example, when the route is not a HostedHttpRoute, the stack looks like HttpWebRoute.GetRouteData -> HttpContextBaseExtensions.GetOrCreateHttpRequestMessage -> HttpControllerHandler.ConvertRequest -> MyBufferlessPolicySelector.

This seems like a bug to me, or at least a very odd limitation. Do you have any thoughts on how I might work around this? A couple thoughts would be to not use HttpControllerHandler, or to manually do some crude route matching myself in my selector, but neither of these solutions are that great.

Edited Unassigned: No route data in IHostBufferPolicySelector.UseBufferedInputStream [2305]

$
0
0
I’m trying to use IHostBufferPolicySelector to disable input buffering on a per-route basis, but have been unsuccessful so far.
It looks like route data doesn’t make it into UseBufferedInputStream because the policy selector is sometimes called during route selection, and sometimes after.

If the route is a HostedHttpRoute, and there are no constraints, then the HttpRequestMessage is not created (and thus ConvertRequest and the policy selector are not called) until ProcessRequestAsyncCore is called. At that point, the request context contains the route data.

Otherwise however, the HttpRequestMessage is created (and the policy selector is called) while in GetRouteData. This means that the request context doesn’t yet contain the route data. For example, when the route is not a HostedHttpRoute, the stack looks like HttpWebRoute.GetRouteData -> HttpContextBaseExtensions.GetOrCreateHttpRequestMessage -> HttpControllerHandler.ConvertRequest -> MyBufferlessPolicySelector.

This seems like a bug to me, or at least a very odd limitation.

Viewing all 7925 articles
Browse latest View live