我在树莓派上使用mono(3.0.3)。除了实体框架之外,一切都正常。我可以在没有问题的情况下登录到我的网站,但第二个我进入了一个有实体框架的区域我在XSP中遇到以下错误:
Application Exception
System.InvalidProgramException
Invalid IL code in System.Data.Objects.ObjectContext:.ctor (string,string): method body is empty.
Description: HTTP 500.Error processing request.
Details: Non-web exception. Exception origin (name of application or object): AdwenModel.
Exception stack trace:
at AdwenModel.AdwenEntities1..ctor (System.String connectionString) [0x00000] in <filename unknown>:0
at AdwenWeb.App_Code.AdwenConnection.getDataContextAdwen () [0x00000] in <filename unknown>:0
at AdwenWeb.Management.overview.createObjectTable () [0x00000] in <filename unknown>:0
at AdwenWeb.Management.overview.Page_Load (System.Object sender, System.EventArgs e) [0x00000] in <filename unknown>:0
at System.Web.UI.Control.OnLoad (System.EventArgs e) [0x00029] in /opt/mono-3.0/mono/mcs/class/System.Web/System.Web.UI/Control.cs:1211
at System.Web.UI.Control.LoadRecursive () [0x00031] in /opt/mono-3.0/mono/mcs/class/System.Web/System.Web.UI/Control.cs:1641
at System.Web.UI.Page.ProcessLoad () [0x0004a] in /opt/mono-3.0/mono/mcs/class/System.Web/System.Web.UI/Page.cs:1490
at System.Web.UI.Page.ProcessPostData () [0x0004d] in /opt/mono-3.0/mono/mcs/class/System.Web/System.Web.UI/Page.cs:1475
at System.Web.UI.Page.InternalProcessRequest () [0x001bf] in /opt/mono-3.0/mono/mcs/class/System.Web/System.Web.UI/Page.cs:1442
at System.Web.UI.Page.ProcessRequest (System.Web.HttpContext context) [0x00062] in /opt/mono-3.0/mono/mcs/class/System.Web/System.Web.UI/Page.cs:1269
Version Information: 3.0.3 (master/c1b505c Thu Dec 6 09:17:47 UTC 2012); ASP.NET Version: 4.0.30319.17020
不知道还有什么可能是错的。
答案 0 :(得分:1)
我对Mono中的实体框架支持知之甚少,但我所知道的是它们在Mono中包含了EF6,而System.Data.Objects不再是EF6中ObjectContext的命名空间。无论导致失败的是什么,都应该寻找System.Data.Entity.Core.Objects.ObjectContext。
希望这有帮助。