asp.net
You can subscribe to the asp.net tag micro-feed.
We have a multi-tenant website that allows a single app to be deployed to a web farm to manage requests for ~1,000 different websites. Content and themes are looked up based on the host name. Traditionally, we used a component list to customise the HTML served for each theme, where you could set specific components […]
The short version on the difference between AddDefaultIdentity and AddIdentity is the default part adds in all the built-in controllers and views for logging in, recovering accounts, and password resets but doesn’t add roles. You can, though, add roles to AddDefaultIdentity to get all the things. AddDefaultIdentity This examples shows how to add the default […]
This was the first time I needed to create an end-to-end process with GitHub Actions and Octopus Deploy. Here’s how I did it. The set up is a .NET (Core 3.1 currently) website that has an existing Publishing Profile that I have been using to create the artefacts as I’ve been testing different hosting scenarios. […]
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 references […]
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 to […]
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. […]
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 transform […]
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 something […]
This is a useful pattern that I have successfully employed a couple of times with ASP.NET MVC applications; creating Widgets with RenderAction. The prevalent way to create a page in ASP.NET MVC is to grab a bunch of stuff in the controller and pass it into a view to be rendered. As the application grows, […]
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 extension […]