ASP.NET: How to avoid ArgumentNullException in StructureMap controller factory

I am using StructureMap as my IoC container. In my ASP.NET MVC web application I have controller factory based on StructureMap. I found interesting problem – when running my web application on development web server I get ArgumentNullException with every request to some controller action. In this posting I will describe why it is happening and how to avoid it.

Read more

Visual Studio: How to include missing namespaces

Some of my readers have problem with detecting correct namespaces to include in code samples. Here is how to get references in place using Visual Studio IDE. You can let Visual Studio to solve references to types that have no namespaces for them included in code file. Move cursor to unreferenced type, right click on it with mouse, select Resolve and then select correct type

Read more

ASP.NET MVC 3: Using global action filters to find out running time of controller actions

Lately I blogged about global action filters in ASP.NET MVC 3. Yesterday I found cool article from Nick Berardi’s Coder Journal where he introduces how to use action filters to measure running time of ASP.NET MVC controllers. And here is my experiment – how to use global action filters to find out how long controller actions are running. You just need couple of lines of code.

Read more