How to fix problems with 404 errors and ScriptResource.axd
I recently had this problem when working with an older site – I fixed it by changing the AppPool Managed Pipeline mode to “Classic”. Why that worked I had no idea, but work it did!
Linq projection with the extension method syntax
I’ve looked this up an embarrassing number of times – here is how you do linq projection with the extension method syntax List<TypeClassification> typeClassifications = ctx.Classes.Select(e => new TypeClassification() {Name = e.Name, TypeClassificationID = e.ClassificationID}).ToList(); Hopefully I shall remember. I’m not sure why I can’t remember the exact syntax.
How to set mime types, aka Content Types with Windows Azure Storage
The Problem I recently came across the conundrum of files not being availble for download after I uploaded them to Windows Azure Storage. The Cause Usually the problem is an incorrect mime type, but since Azure does not have mime types I had to do some more digging. The Solution It turns out there is […]
How to fix problems in adding ssl certs on Windows Azure Websites
For some reason, most likely because you never do it more than once a year, adding ssl certificates to a server is poorly documented and unnecessarily complicated. Here are some things I learned recently about adding ssl certs on Windows Azure Websites. I recently added a cert to this site, https://digitaltoolfactory.net which is hosted on Windows […]
How to explain caching to clients
I recently implemented a quick performance fix on a client’s site recently by implementing caching. I explain caching with the following metaphor. Imagine that your site is a book. A book written in a weird mix of Latin, Sanskrit and Old Norse. It’s precise, complicated and requires translation into English by an expert translator before it […]
How to install wordpress in a subdirectory of a site with an existing .htaccess file
This happened to me whilst working on a pre-existing site recently. The Problem You are trying to install WordPress onto a subdirectory of an existing site that uses the .htaccess files for routing. When you try to add in the changes needed for WordPress to work you break the existing site. The Cause WordPress .htaccess […]
The case of the disappearing WordPress widgets
A silly one this time The Problem I was recently working on someone else’s WordPress theme that made extensive use of WordPress Widgets and the new dynamic sidebar feature. I was able to recreate the widgets (there was a working staging site) but the on the production site the widgets did not appear. What to […]
How to fix the infamous “Unable to cast object of type ‘System.Int32’ to type ‘System.String’ error in asp.net mvc
The Problem You have created a lovely model in asp.net mvc 4, using Entity Framework and a whole host of attributes. One of the properties of your model looks like this [Required] [Display(Name = “Expiration Month (MM)”)] [StringLength(2,ErrorMessage = “You must enter two digits”, MinimumLength = 1)] [Range(1,12, ErrorMessage = “You must enter a valid […]
How to fix problems with data cacheing in ASP.net MVC 4, SignalR and Entity Framework
The Problem I was using the wonderful SignalR libraries to create a status window (I have a VERY long running process in my new Data Hammer project, it takes about 15 minutes to run) and I need to inform the user on where the process is at any given time. My original code looked like […]
How to configure wildcard routing in asp.net mvc 4
The Problem You are trying to configure Widlcard routing (i.e. something like https://domain.com/SomeUserName/) and find it problematic. The Cause That is largely by design – wildcard routing is resource intensive and rarely needed. The Solution If you want to do it anyway, use the following routes routes.MapRoute(“Default”, “”, new { controller = “Home”, action = […]