This is actually a configuration error, as described here
http://www.codepal.co.uk/show/WOFF_files_return_404_in_Azure_Web_Sites
The solution was to add the following to the web.config:
<system.webServer>
<staticContent>
<mimeMap fileExtension="woff" mimeType="application/font-woff" />
<mimeMap fileExtension="woff2" mimeType="application/font-woff" />
</staticContent>
Sunday, December 11, 2016
Thursday, September 15, 2016
OpenVPN not changing my IP address
When I installed the OpenVPN client and connected to a VPN it changed my IP address correctly. However, subsequent times it didn't change it. It turned out I had to run the application as an administrator, and that was it.
Monday, June 27, 2016
How to return a 401 status code using ASP.NET MVC 5 and OWIN
This time I was trying to force users to the login page after an Ajax request failed because of an expired session. I was getting something like this in the response:
X-Responded-JSON: {"status":401,"headers":... I investigated a little and turned out you have to add this code to your Startup.Auth.cs file: Provider = new CookieAuthenticationProvider { OnApplyRedirect = ctx => { if (!IsAjaxRequest(ctx.Request)) { ctx.Response.Redirect(ctx.RedirectUri); } }}
Also, in your filter I suggest you do something like this:
if (filterContext.HttpContext.Request.IsAjaxRequest())
{
filterContext.HttpContext.Items["RequestWasNotAuthorized"] = true;
filterContext.HttpContext.Response.StatusCode = 401;
filterContext.HttpContext.Response.End();
filterContext.Result = new HttpUnauthorizedResult();
}
And then handle it in JavaScript like this:
$(document).ajaxError(function (xhr, props) {
if (props.status === 401) {
location.reload();
}
});
More information on the error can be found here:http://kevin-junghans.blogspot.mx/2013/12/returning-401-http-status-code-on.htmlhttps://brockallen.com/2013/10/27/using-cookie-authentication-middleware-with-web-api-and-401-response-codes/Wednesday, June 15, 2016
A connection was successfully established with the server, but then an error occurred during the login process. (provider: Shared Memory Provider, error: 0 - The handle is invalid.)
The solution is simple, just reset IIS. If that doesn't work, this SO question will help
http://stackoverflow.com/questions/3270199/a-connection-was-successfully-established-with-the-server-but-then-an-error-occ
http://stackoverflow.com/questions/3270199/a-connection-was-successfully-established-with-the-server-but-then-an-error-occ
Sunday, May 15, 2016
Run Visual Studio as an administrator all the time
Why is it that right-clicking the Visual Studio icon and then clicking Visual studio opens the application as an administrator (after you configure it this way in the properties window) but right-clicking the Visual Studio icon and then clicking a project doesn't? In Windows 8 and 10 you have to follow a few more steps as defined here (http://stackoverflow .com/questions/96548 33/how-to-run-visual -studio-as-administr ator-by-default)
Right-click devenv.exe and select "Troubleshoot compatibility".
- select "Troubleshoot program"
- check "The program requires additional permissions" click "Next", click "Test the program..."
- wait for the program to launch
- click "Next"
- select "Yes, save these settings for this program"
- click "Close"
Wednesday, April 13, 2016
Entity Framework - Store update, insert, or delete statement affected an unexpected number of rows (0)
This error can have several causes, in my case it was that I had forgotten to create the PK and identity columns in a table. More complex causes can be found here http://stackoverflow.com/questions/1836173/entity-framework-store-update-insert-or-delete-statement-affected-an-unexpec
Saturday, April 9, 2016
PowerShell - "AuthorizationManager check failed" from Octopus Deploy
I came across this error when trying to run Import-Module in an Octopus Deploy PowerShell script. This script was in the source code. What I end up doing was taking out Import-Module into its own Octopus Deploy step "Run a Script".
This article also thoroughly explain the reason for the error http://tgnp.me/2011/09/powershell-authorizationmanager-check-failed-resolution/
In the process, I also learned that Octopus Deploy changes the execution policy of the Powershell process to unrestricted.
This article also thoroughly explain the reason for the error http://tgnp.me/2011/09/powershell-authorizationmanager-check-failed-resolution/
In the process, I also learned that Octopus Deploy changes the execution policy of the Powershell process to unrestricted.
Subscribe to:
Posts (Atom)