动态数据实体网站与edmx在Visual Studio 2012中没有,但它没有用。我收到了错误 [英] Dynamic Data Entities Web Site with edmx doesnt in visual studio 2012 and it didnt worked. I got the error

查看:103
本文介绍了动态数据实体网站与edmx在Visual Studio 2012中没有,但它没有用。我收到了错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建了一个新的 动态数据实体网站与edmx它在视觉工作室2010上工作,我在视觉工作室2012中做了完全相同,它没有工作。我收到错误


 

  DefaultModel.RegisterContext(typeof(AdventureWorksModel.AdventureWorksEntities),new ContextConfiguration(){ScaffoldAllTables = true });
$

I create a new  Dynamic Data Entities Web Site with edmx it worked on visual studio 2010 and I did exactly the same in visual studio 2012 and it didnt worked. I got an error on the line
 
 DefaultModel.RegisterContext(typeof(AdventureWorksModel.AdventureWorksEntities), new ContextConfiguration() { ScaffoldAllTables = true});





我将我的实体放在typeof()中,就像我在视觉中所做的那样工作室2010.

$




视觉工作室2010与2012年视觉工作室有所不同?



谢谢,Michal


I put the my entity in the typeof() as I did in visual studio 2010.



There is a diffrent from visual studio 2010 to visual studio 2012?

Thanks, Michal

推荐答案

这是错误:

不支持上下文类型'GPE2.GpeTwoDBEntities'。


描述:发生了未处理的异常在执行当前Web请求期间。请查看堆栈跟踪以获取有关错误及其源自代码的位置的更多信息。


$
异常详细信息: System.ArgumentException:不支持上下文类型"GPE2.GpeTwoDBEntities"。



来源错误:




This is the error:

The context type 'GPE2.GpeTwoDBEntities' is not supported.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.ArgumentException: The context type 'GPE2.GpeTwoDBEntities' is not supported.

Source Error:


Line 31:             // See http://go.microsoft.com/fwlink/?LinkId=257395 for more information on how to add and configure an Entity Data model to this project
Line 32: 
Line 33:             DefaultModel.RegisterContext(typeof(GPE2.GpeTwoDBEntities), new ContextConfiguration() { ScaffoldAllTables = true });
Line 34:             // The following statement supports separate-page mode, where the List, Detail, Insert, and 
Line 35:             // Update tasks are performed by using separate pages. To enable this mode, uncomment the following 




这篇关于动态数据实体网站与edmx在Visual Studio 2012中没有,但它没有用。我收到了错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆