在Arduino项目中使用Mono和ASP.NET的System.TypeLoadException

时间:2013-10-16 10:46:43

标签: c# asp.net apache mono arduino

我正在尝试使用网页来控制Arduino上的LCD屏幕。从Visual Studio(2012)运行时,网页可以正常工作,但是当尝试使用mod_mono部署到我的Apache服务器时,我得到了这个神秘的错误。这是完整的错误:

Could not load type 'System.Web.UI.ScriptResourceDefinition' from assembly
'System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'.

Description: HTTP 500.Error processing request.
Details: Non-web exception. Exception origin (name of application or object): mscorlib.
Exception stack trace:
    at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (System.Reflection.MonoMethod,object,object[],System.Exception&)
    at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000] in <filename unknown>:0

页面底部的Mono版本报告为:

Version Information: 3.3.0 (master/6cd4ddc); ASP.NET Version: 4.0.30319.17020

我在应用程序中所做的只是从一个盒子中取出文本并通过串口发送到我的Arduino。

据我所知,我得到的错误并没有真正告诉我任何事情。可能是因为从实际服务器运行时串口不起作用?它适用于Visual Studios服务器,Mono附带的XPS测试可以与我的Apache服务器一起使用。

我想制作这个网页,以便来自全国各地的朋友可以向我的Arduino液晶显示器发送信息。 :)非常感谢能帮助我的人。

编辑:将System.Web.Extensions.dll从Mono的文件夹移动到bin文件夹后,我收到此错误:

System.InvalidOperationException
Assembly 'System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' does not contain a Web resource with name 'jquery'.

Description: HTTP 500.Error processing request.
Details: Non-web exception. Exception origin (name of application or object): System.Web.Extensions.
Exception stack trace:
  at System.Web.UI.ScriptReferenceBase.VerifyAssemblyContainsResource (System.Reflection.Assembly assembly, System.String resourceName, System.Web.UI.WebResourceAttribute& wra) [0x00000] in <filename unknown>:0 
  at System.Web.UI.ScriptReferenceBase.GetScriptName (System.String releaseName, Boolean isDebugMode, System.String[] supportedUICultures, System.Reflection.Assembly assembly, System.Web.UI.WebResourceAttribute& wra) [0x00000] in <filename unknown>:0 
  at System.Web.UI.ScriptReference.GetUrl (System.Web.UI.ScriptManager scriptManager, Boolean zip) [0x00000] in <filename unknown>:0 
  at System.Web.UI.ScriptManager.RegisterScriptReference (System.Web.UI.Control control, System.Web.UI.ScriptReferenceBase script, Boolean loadScriptsBeforeUI) [0x00000] in <filename unknown>:0 
  at System.Web.UI.ScriptManager.OnPreRenderComplete (System.Object sender, System.EventArgs e) [0x00000] in <filename unknown>:0 
  at System.Web.UI.Page.OnPreRenderComplete (System.EventArgs e) [0x00000] in <filename unknown>:0 
  at System.Web.UI.Page.ProcessLoadComplete () [0x00000] in <filename unknown>:0 
  at System.Web.UI.Page.InternalProcessRequest () [0x00000] in <filename unknown>:0 
  at System.Web.UI.Page.ProcessRequest (System.Web.HttpContext context) [0x00000] in <filename unknown>:0 

有时我会收到此错误,有时与以前相同。取决于Apache的心情我想。

1 个答案:

答案 0 :(得分:0)

该类位于System.Web.Extensions.dll,请确保DLL位于您的bin文件夹中。