0

全部,

我是 ASP.NET 编程的新手,我正在尝试做一些示例来入门。我在 Xamarin 4.0.8(构建 2)中执行此操作。当我尝试打开Default.aspx文件(创建项目时生成)时,遇到以下异常警告:

System.Exception: System.Web assembly name not found for framework .NETFramework,Version=v4.5
at MonoDevelop.AspNet.WebTypeContext.GetSystemWebDom(TargetRuntime runtime, TargetFramework targetFramework)
at MonoDevelop.AspNet.WebTypeContext.GetSystemWebDom(AspNetAppProject project)
at MonoDevelop.AspNet.WebTypeContext..ctor(AspNetAppProject project)
at MonoDevelop.AspNet.Parser.DocumentReferenceManager..ctor(AspNetAppProject project)
at MonoDevelop.AspNet.Gui.AspNetEditorExtension.OnParsedDocumentUpdated()
at MonoDevelop.XmlEditor.Gui.BaseXmlEditorExtension.<Initialize>b__0(Object , EventArgs )
at System.EventHandler.Invoke(Object sender, EventArgs e)
at MonoDevelop.Ide.Gui.Document.OnDocumentParsed(EventArgs e)
at MonoDevelop.Ide.Gui.Document.<>c__DisplayClass1c.<>c__DisplayClass1e <>c__DisplayClass20.<StartReparseThread>b__1b(Object , EventArgs )
at Gtk.Application.InvokeCB.Invoke()
at GLib.Timeout.TimeoutProxy.Handler()

此外,我稍后收到此异常:

System.NullReferenceException: Object reference not set to an instance of an object.
at MonoDevelop.AspNet.Gui.AspNetEditorExtension.OnParsedDocumentUpdated()
at MonoDevelop.XmlEditor.Gui.BaseXmlEditorExtension.<Initialize>b__0(Object , EventArgs )
at System.EventHandler.Invoke(Object sender, EventArgs e)
at MonoDevelop.Ide.Gui.Document.OnDocumentParsed(EventArgs e)
at MonoDevelop.Ide.Gui.Document.<>c__DisplayClass1c.<>c__DisplayClass1e.<>c__DisplayClass20.<StartReparseThread>b__1b(Object , EventArgs )
at Gtk.Application.InvokeCB.Invoke()
at GLib.Timeout.TimeoutProxy.Handler()

最终它到达了 IDE 必须关闭的地步。

我尝试将目标框架从 Mono/.NET 4.0 切换到 Mono/.NET 4.5,但无济于事。

似乎它只是没有找到 System.Web 库。我怎么把它指向那里?

4

1 回答 1

0

该错误具有误导性,至少在 Windows 机器上是这样。您需要启用 .NET Framework 2.0 和 3.0 才能消除此错误。此外,如果您需要在控件方面保持 .aspx 和 Designer.aspx.cs 同步。

于 2014-03-23T03:10:12.403 回答