Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MvcBuildViews true with Entity Framework in ASP.NET MVC 2

In VS 2010, changing <MvcBuildViews>true</MvcBuildViews> in a MVC2 project's .csproj file causes an error if you are using Entity Framework.

Could not load type 'System.Data.Entity.Design.AspNet.EntityDesignerBuildProvider'. C:\Windows\Microsoft.NET\Framework\v4.0.30319\Config\web.config 129

I want to build views while I'm debugging, and I also want my project to compile!

like image 572
Alper Avatar asked May 04 '10 01:05

Alper


1 Answers

You can resolve this MVC compile issue by adding the following element to your web.config file:

<add assembly="System.Data.Entity.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" /> 

This will tell the compiler where to find that missing type.

like image 192
a7drew Avatar answered Sep 19 '22 12:09

a7drew