locked
'System.Data.Entity.DbContext' is defined in an assembly that is not referenced RRS feed

  • Question

  • User-973886032 posted

    hi guys,

    i made a reference to a connection string in a class e.g. ( Code below has been edited )

    I did a google search and found http://stackoverflow.com/questions/5741109/the-type-or-namespace-name-dbcontext-could-not-be-found

    I did a search and downloaded a dll version from the internet, however it says its version 5.0 and not compatible with version 4.5 which am using

    Pls advice

    Ehi

    namespace xxxxy_ApplicationCodes
    {
        public class DataManipulation
        {
    
            xxxxx_Gifts_Entities db = new xxxx_Gifts_Entities();
    
    
        }
    }



    And I get the error

    Error	1	The type 'System.Data.Entity.DbContext' is defined in an assembly that is not referenced. You must add a reference to assembly 'EntityFramework, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.	d:\projects\xxxx_website\xxxxx_ApplicationCodes\DataManipulation.cs	12	34	xxxxx_ApplicationCodes
    



    Saturday, November 3, 2012 8:28 PM

Answers

  • User-973886032 posted

    I solved this, I was using a wrong version.

    I downloaded the 5.0 version using the NuGet package installer.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Sunday, November 4, 2012 8:37 AM

All replies

  • User-973886032 posted

    I solved this, I was using a wrong version.

    I downloaded the 5.0 version using the NuGet package installer.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Sunday, November 4, 2012 8:37 AM
  • User3866881 posted

    Hello,

    I come here to close the issue by marking yours, so if you have any other problems please create a new thread to continue;)

    Reguards!

    Sunday, November 4, 2012 8:35 PM