The type or namespace name ‘ApplicationInsights’ does not exist in the namespace ‘Microsoft’

If you uninstall the Application Insights package from a .NET Core MVC project, you might get a few errors as it can’t “remove all the references” that might have made it into your application. The changes to StartUp.cs will be pretty self-explantory, but elsewhere you will get something a bit more off-the-wall as it referencesContinue reading “The type or namespace name ‘ApplicationInsights’ does not exist in the namespace ‘Microsoft’”

IISExpress.exe Exited With Access Violation

I was happily typing away at some ASP.NET Core controllers and views, calling a view component to render out some paging links, when this happened… The program iisexpress.exe’ has exited with code -1073741819 (0xc0000005) ‘Access violation’. No exception visible in Visual Studio. No indication of where the error was. Nothing. The Internet supplied links toContinue reading “IISExpress.exe Exited With Access Violation”

Prevent AJAX Requests Making Sessions Infinite in ASP.NET MVC

If you are terminating inactive sessions in your ASP.NET MVC application and you add an AJAX polling call, the chances are you’ll make your sessions last forever thanks to the AJAX request bringing down an updated session cookie. This is because the AJAX call will pull down an updated auth cookie and extend your timeout.Continue reading “Prevent AJAX Requests Making Sessions Infinite in ASP.NET MVC”

Real Life Performance Cost of compilation debug=”true”

There is a little setting in your ASP.NET Web.config file that sets compilation debug to true. If you debug your application locally, this gets set for you if it hasn’t been set already… <system.web> <compilation debug=”true” targetFramework=”4.5.2″ /> <!– … –> This is necessary for debugging, but also costly. That’s why your default Web.Release.config transformContinue reading “Real Life Performance Cost of compilation debug=”true””

Minification Failed. Returning Unminified Contents.

Has you ASP.NET applicaiton reported that minification failed? If you are using bundles in application, you might come across this exception comment at the top of your larger-than-expected bundle file. /* Minification failed. Returning unminified contents. (List of problems here) */ It can happen for JavaScript or CSS, but it means minifier has found somethingContinue reading “Minification Failed. Returning Unminified Contents.”

Conditionally Apply IIS URLRewrite Rules

If you are using the IIS URLRewrite module to fix up your request URLs, you may well come across the need to conditionally apply rules. For example, the following rule redirects all “.aspx” pages in the root of the web application to an extensionless URL: In this rule, the name is preserved, but the extensionContinue reading “Conditionally Apply IIS URLRewrite Rules”