Value cannot be null. Parameter name: entitySet

I had the same issue and the cause was a POCO class that had a property of type Type.


Late to the game...but if it helps...

I had this same problem, everything was working fine, but this issue appeared, I added the following to one of my classes

public HttpPostedFileBase File { get; set; }

which seemed to break it.

I ensured I didn't map this to the database by using the following:

[NotMapped]
public HttpPostedFileBase File { get; set; }

You need to add the following using statement:

using System.ComponentModel.DataAnnotations.Schema;

Hope this helps


This problem can occur if one of the POCO classes was not declared in the DbContext.

I added them and the error went away

I had changed the name of the Task POCO class because of its association with a built in .NET name System.Threading.Tasks. However I had not changed this in the "TaskTimeLog" POCO where there was a relation. When going through the code the "Task" property in the "TaskTimeLog" POCO was not showing an error because it was now attached to that threading keyword and the reason I had changed the name in the first place.