ASP.NET MVC 3 add controller throws error "Object reference not set to an instance of object"

admin

Administrator
Staff member
I get below error when I try to add controller to my ASP.NET MVC 3 intranet project

<blockquote>
Object reference not set to an instance of object
</blockquote>

I am following an article <a href="http://sumitmaitra.wordpress.com/2011/11/13/fun-with-signalr/" rel="nofollow noreferrer">http://sumitmaitra.wordpress.com/2011/11/13/fun-with-signalr/</a> to develop SignalR application.

I doubt that after installing SignalR something went wrong but not very sure about it.

<h2>Edit</h2>

Model code:

Code:
public class BlogPost
{
    [Key]
    public int Id { get; set; }
    [Required]
    public string Title { get; set; }
    public string Post { get; set;}
}

DbContext:

Code:
namespace SignalR.Models
{
    public class BlogPostContext : DbContext
    {
        public DbSet&lt;BlogPost&gt; BlogPosts { get; set; }
    }
}

Controller:

<img src=" " alt="Controller">