I have a \"MVC 4\" project and i want to add an assembly to web.config file but i don\'t know where should i put it. I try any ways but i cant find the solu
It is quite simple. Look at your compilation section in your web.config:
<compilation debug="true" targetFramework="4.0"/>
Now open the section and put your assembly inside like this:
<compilation debug="true" targetFramework="4.0">
<assemblies>
<add assembly="System.Data.Entity, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
</assemblies>
</compilation>
Libraries in this section are checked in compilation time, it has nothing to do with runtime binding.
I just experienced the same issue with MVC 4 in VS Express 2012 for Web, but, while Alfonso's answer was much more helpful than anything else I found on the Web, it unfortunately did not clear up the error in my project. After doing some research on the Internet (to no avail) and then just poking around Visual Studio, I found the following solution.
In addition to adding EntityFramework to my project's references and adding the tag to my Web.config, I also had to take the following steps to satisfy the compiler: