How to add assembly in web.config file of mvc 4

后端 未结 2 751
太阳男子
太阳男子 2020-12-09 08:38

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

2条回答
  •  南方客
    南方客 (楼主)
    2020-12-09 09:03

    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:

    1. Right-click the References folder > Add Reference...
    2. Expand Assemblies on the left side of the window and select Framework.
    3. Scroll to and select System.Data.Entity in the list of assemblies.
    4. Make sure the box next to System.Data.Entity is checked, then click 'OK'.
    5. Rebuild the project.

提交回复
热议问题