none
The context type 'WebApplication3.AdventureWorks2012_DataEntities' is not supported RRS feed

  • Question

  • I have a VS2012, EF (Entity Framework) 5, .NET Framework 4.5, Web Application using these addins to the project:
    • ASP.NET Dynamic Data Entities Web Application
    • ADO.NET Entity Data Model

    The project compiles fine but when I run it in IE, I get this error: The context type 'WebApplication3.AdventureWorks2012_DataEntities' is not supported.  I did modify the global.asmx file as the walkthrough in this link instructs:  http://msdn.microsoft.com/en-us/library/cc488469(v=vs.100).aspx, to be this, which is my model database connection string name: 

    DefaultModel.RegisterContext(typeof(AdventureWorks2012_DataEntities), new ContextConfiguration() { ScaffoldAllTables = false });

    I have also recreated the same problem and runtime error in VS2013 RC, with EF 6.

    Wednesday, September 25, 2013 3:26 PM

Answers

  • Hello,

    For the issue “the context type XXX is not supported”, as far as I know, it happens because in Visual Studio 2012 it gets DbContext (instead of ObjectContext as in Visual Studio 2010) code generated by default for all new models created with the EF Designer. In order to solve one it needs to revert back to ObjectContext code generation.

    For more information see Reverting to ObjectContext in EF Designer:

    http://msdn.microsoft.com/en-us/data/jj556581.aspx

    And here is a link regarding this issue:

    http://blogs.msdn.com/b/webdev/archive/2012/08/15/using-dynamic-data-with-entity-framework-dbcontext.aspx

    Thanks &Regards.



    <THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED>
    Thanks
    MSDN Community Support

    Please remember to "Mark as Answer" the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.

    • Marked as answer by Fred BaoModerator Wednesday, October 2, 2013 1:21 AM
    • Unmarked as answer by bob_king_ATL Sunday, October 6, 2013 1:55 AM
    • Marked as answer by bob_king_ATL Sunday, October 6, 2013 1:55 AM
    Thursday, September 26, 2013 4:30 AM
    Moderator

All replies

  • Hello,

    For the issue “the context type XXX is not supported”, as far as I know, it happens because in Visual Studio 2012 it gets DbContext (instead of ObjectContext as in Visual Studio 2010) code generated by default for all new models created with the EF Designer. In order to solve one it needs to revert back to ObjectContext code generation.

    For more information see Reverting to ObjectContext in EF Designer:

    http://msdn.microsoft.com/en-us/data/jj556581.aspx

    And here is a link regarding this issue:

    http://blogs.msdn.com/b/webdev/archive/2012/08/15/using-dynamic-data-with-entity-framework-dbcontext.aspx

    Thanks &Regards.



    <THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED>
    Thanks
    MSDN Community Support

    Please remember to "Mark as Answer" the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.

    • Marked as answer by Fred BaoModerator Wednesday, October 2, 2013 1:21 AM
    • Unmarked as answer by bob_king_ATL Sunday, October 6, 2013 1:55 AM
    • Marked as answer by bob_king_ATL Sunday, October 6, 2013 1:55 AM
    Thursday, September 26, 2013 4:30 AM
    Moderator
  • Thank you.  That was the problem.

    Bob King

    Sunday, October 6, 2013 1:56 AM