I ran into this issue earlier today after updating Visual Studio for Mac. I had tried debugging a site, and was met with the error message in Safari that it couldn't establish a secure connection with the server. Kestrel was running, and the port was correctly open -- it's just that the SSL/TLS negotiation was failing.
Continue readingMonth: July 2019
ASP.NET: @section Scripts in a Partial View
A @section Scripts
block does not work when placed in a partial view in ASP.NET. Unfortunately, you don't get any error messages if you try to add the section to a partial -- it just does nothing. In many cases, having a scripts section in a partial view would be an anti-pattern, since the partial can be rendered an unknown number of times. However, there are times when I believe a scripts section is warranted in a partial, particularly when you're trying to create dynamic JavaScript based on the model passed into the partial view. While you can't just use the actual @section Scripts
in a partial view, you can add some HTML helper extensions to accomplish the same thing.
ASP.NET Core: Invalid non-ASCII or control character in header
I'm running some ASP.NET Core applications under Kestrel on Linux proxied by NGINX. I ran into an issue recently where I was getting the following exception when I redirected with certain strings:
System.InvalidOperationException: Invalid non-ASCII or control character in header: 0x00ED