Why does vs2012 fail to find EF when adding a domain service?

Source: Internet
Author: User
Tags silverlight

The project I created is Silverlight business application, Silverlight version 5, and comes with WCF Ria. Since there is no new SQL Server to be used, use entity framework as an Orm.

None of the above is difficult. Create a database table and an ADO. NET Entity model. The next step is to add a new domain service and associate it with the entity model just created.

Unfortunately, the problem is:

All available context classes are available, and a prompt says "Some Entity Framework context classes may have been excluded "!

 

Of course, this problem is hard for me. After Google for half a day, it finally has a result.

Cause

In vs2012, Entity Framework creates a context class based on dbcontext by default (this word is awkward). However, wcf ria does not support it.

Solution

I will translate it directly:

To solve this problem, you must convert it into an objectcontext-based model. Do the following:

1. Open your entity model in the designer (if necessary, click the blank area in the designer to ensure that no object is selected ).

2.AttributeWindow, changeCode Generation Policy, FromNoneChangeDefault.

3. Delete the two. TTFile. Assume that you have not modified these files since the entity model is created. If you have made any changes, these changes will be lost.

4. regenerate the project.

Now the problem is solved.

Why does vs2012 fail to find EF when adding a domain service?

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.