Refernce to Entity Framework

Posted on 2014-08-01
Last Modified: 2014-08-04
I have a web MVC project with Entity Framework 4.x working fine.

Now I added a class library project in the same solution, and I have mapped different database tables successfully. .edmx is generated. Then I write a simple test class and try to build the this new project. I got error - The namespace name Infrastructure does not exist in a namespace System.Data.Entity ...

I googled it and was said I need a reference to the EntityFramework or need to install EntityFramework. I'm confused, as I already have a web MVC project working, and also .edmx has been built in the new class library project. So EntityFramework should not be a problem...?

What should do to remove this error?

I may need to add a reference to the class library project in the existing web project, so that the web project can use classes defined in the class library project, right?

I appreciate any help.
Question by:minglelinch
    LVL 62

    Accepted Solution

    Do you have a using statement to the Infrastructure as shown below. This namespace is found in the EntityFramework.dll so make sure that the project this is in has the Entity Framework dll as well.

    using System.Data.Entity.Infrastructure;
    LVL 1

    Author Closing Comment

    Thank you

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Do You Know the 4 Main Threat Actor Types?

    Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

    Introduction Although it is an old technology, serial ports are still being used by many hardware manufacturers. If you develop applications in C#, Microsoft .NET framework has SerialPort class to communicate with the serial ports.  I needed to…
    For a while now I'v been searching for a circular progress control, much like the one you get when first starting your Silverlight application. I found a couple that were written in WPF and there were a few written in Silverlight, but all appeared o…
    It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
    This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA.…

    759 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    11 Experts available now in Live!

    Get 1:1 Help Now