When Entity Framework (EF) is used in MVC, the "system. Data. Entity" solution for the Assembly must be added

Source: Internet
Author: User

By default, only the reference of the LINQ assembly is added to Web. config generated in MVC. If Entity Framework (EF) is used as the orm of MVC, you need to add the Assembly reference in webconfig:

For example:

<Assemblies>
......

<Add Assembly = "system. xml. LINQ, version = 3.5.0.0, culture = neutral, publickeytoken = b77a5c561934e089"/>
<Add Assembly = "system. Data. LINQ, version = 3.5.0.0, culture = neutral, publickeytoken = b77a5c561934e089"/>
<Add Assembly = "system. Data. entity, version = 3.5.0.0, culture = neutral, publickeytoken = b77a5c561934e089"/>
</Assemblies>

Asp.net MVC 2 cocould not load type 'System. Web. MVC. viewpage <dynamic> 'error Solution

If problems such as cocould not load type 'System. Web. MVC. viewpage <dynamic> 'occur. Add pageparserfiltertype, pagebasetype, and usercontrolbasetype to the pages node under the system. Web node in the web. config file, as follows:

Code

<System. Web>
<Pages pageparserfiltertype = "system. Web. MVC. viewtypeparserfilter, system. Web. MVC, version = 2.0.0.0, culture = neutral, publickeytoken = 31bf3856ad364e35"
Pagebasetype = "system. Web. MVC. viewpage, system. Web. MVC, version = 2.0.0.0, culture = neutral, publickeytoken = 31bf3856ad364e35"
Usercontrolbasetype = "system. Web. MVC. viewusercontrol, system. Web. MVC, version = 2.0.0.0, culture = neutral, publickeytoken = 31bf3856ad364e35">
</Pages>
</System. Web>

If problems such as cocould not load type 'System. Web. MVC. viewpage <dynamic> 'occur. Add pageparserfiltertype, pagebasetype, and usercontrolbasetype to the pages node under the system. Web node in the web. config file, as follows:

Code

<System. Web>
<Pages pageparserfiltertype = "system. Web. MVC. viewtypeparserfilter, system. Web. MVC, version = 2.0.0.0, culture = neutral, publickeytoken = 31bf3856ad364e35"
Pagebasetype = "system. Web. MVC. viewpage, system. Web. MVC, version = 2.0.0.0, culture = neutral, publickeytoken = 31bf3856ad364e35"
Usercontrolbasetype = "system. Web. MVC. viewusercontrol, system. Web. MVC, version = 2.0.0.0, culture = neutral, publickeytoken = 31bf3856ad364e35">
</Pages>
</System. Web>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.