MVC Mini Profiler on IIS 6 - iis-6

Has anyone been able to get the MVC mini profiler working on IIS 6? I've set up the profiler in my application and it works perfectly in Visual Studio, IIS Express and IIS 7.5 but when I put the exact same application onto IIS 6 it won't work.
The problem seems to be around loading /mini-profiler-includes.js, I just get a 404 response. I've checked the route table and the correct routes have been registered by the profiler but apart from that I'm not sure what else to try.

On IIS 7, ASP.NET by default runs in integrated mode so the ASP.NET runtime will handle all requests, however on IIS 6 ASP.NET only handles extensions explicitly listed in the mappings section.
When the request comes in for /mini-profiler-includes.js IIS sees the .js and tries to serve the static file but as the file is "generated" by ASP.NET the handler never gets hit and a 404 error is returned.
In order to fix this you need to add a wildcard mapping to IIS so all requests get handed to ASP.NET. This blog post has a good walkthrough of the process.

Related

ssl access in web API ASP.Net Core 2

I want to force the access to my web API with SSL
In Visual Studio I see this
The to force the calls to use https I have this
.UseRewriter(new RewriteOptions().AddRedirectToHttps(301,44329))
But when I make this call for example: http://localhost:5001/api/proyectos that until now worked fine. Now this call is translated to https://localhost:44329/api/proyectos and the page is nod loaded.
Any idea please?

ASP.NET Core 2.0 site POST request resulting in 404 on Azure

I've just upgraded an ASP.NET Core 1.1 web application to 2.0 and tested without issue locally. However, when the site is deployed to Azure a POST request that worked locally results in a 404 (I guess this could be the same for all POST requests, but I'm unable to log-in due to the issue).
Any ideas why this might fail to be working when deployed to Azure but working perfectly when run through IIS Express locally?
I deleted the original deployment slot on Azure and re-created as initially deploying over the slot mixed old 1.1 DLL's with the newer 2.0 DLL's and prevented the site working at all.
Seems I was caught out by poor handling of errors by my web application. I'd assumed that app.UseExceptionHandler("/Error") (I default my HomeController to not require the leading "Home" for /Home/Error) in Startup.cs would redirect to an error page, but for me it is not.
My underlying issue was a database connection error that caused the POST controller method to fail. I was caught out by the response returning a 404 rather than an error status.
I will need to investigate how error handling works in more detail for ASP.NET Core it seems.

ASP.NET core fails on with

I try to do a performance test on my asp.net core 1.0.1 website. I use loader.io to get 4000 client's to load the website but I get an error on asp.net core. If I run the same code in asp.net 4.6 it runs error on same server. Can anybody tell my why I can't handle same load on my asp.net core site like my asp.net 4.6?
Error:
502 - Web server received an invalid response while acting as a
gateway or proxy server.
There is a problem with the page you are looking for, and it cannot be displayed. When the Web server (while acting as a gateway or proxy) contacted the upstream content server, it received an invalid response from the content server.
ASP.NET 4.6: https://thusan.tinytake.com/sf/MTA4Mzg1OF80MzMzNzMz
ASP.NET core: https://thusan.tinytake.com/sf/MTA4Mzg1OV80MzMzNzM0
I'm running both sites from IIS on a Windows 2012 r2.
In ASP.NET 4, IIS hosts the web site in its own process. ASP.NET Core changed this. ASP.NET Core web sites execute as a separate process and IIS uses the ASP.NET Core Module to reverse proxy requests to the ASP.NET Core process. The error you are seeing could be caused by many problems, such as a setup errors or hung requests in the ASP.NET Core process.
If all requests fail, it is probably a setup error. Follow this document to make sure guide you have completed all steps to deploy an ASP.NET Core app to IIS. https://docs.asp.net/en/latest/publishing/iis.html.
If the ASP.NET Core site works for a few requests but fails under stress, checkout some of these recommendations for improving performance. https://github.com/aspnet/IISIntegration/issues/245#issuecomment-242541999

MVC 4 App with Basic Authentication

I'm getting an error with an application that's using basic authentication for IIS 8. When I start the application it takes too long to run and also it doesn't load the .js and .css files.
The weirdest thing is that the same application loads correctly in other 3 machines but mine.
I defined an Application Pool with my network credentials and on Basic Authentication I also defined the host.
In my MVC project, on Web tab the project url is something like "http://localhost/MyAppName".
Is there anything that I could do to solve this?
Not being able to load .js and .css is usually the case when your application pool is running in Classic mode. Try switching it to Integrated. Also, make sure your pool is running v4.0 .NET Framework.

Asp.net MVC Web Api Http put and delete requests failing

I am using Asp.net MVC 4 Web Api project. MY application uses mvc to implement a web site. It makes http requests to the web api to implement server functionality.
Regular page requests to controllers work fine and it is able to display web pages. The application is able to make get and post requests to the api. But when it tries to to put or delete web requests it gets
"Failed to load resource: the server responded with a status of 501 (Not Implemented) "
The application is hosted on iis 6.
The application works when running a local cassani server instance and is able to make put and delete requests, but as soon as the application is executed from iis it doesn't work as expected.
I tried all the suggestions from the comment above and none of them worked.
I had to add the ASP.NET 4.0 dll to the Wildcard mappings in the Configuration area on the Home Directory tab. That worked for me. Remember to uncheck the "Verify file exists" checkbox.
EDIT: I posted a blog on the exact process to make this happen here: http://www.proworks.com/blog/2012/11/14/how-to-fix-aspnet-mvc-web-api-http-put-and-delete-requests-failing/