System.TypeLoadException with Mono and ASP.NET in Arduino project

流过昼夜 提交于 2019-12-25 18:43:28

问题


I am trying to use a web page to control an LCD screen on an Arduino. The web page works when run from Visual Studio (2012), but when trying to deploy to my Apache server with mod_mono, I get this cryptic error. This is the complete error:

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

And the Mono version on the bottom of the page reports as:

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

All I'm doing in the application is taking text from a box and sending it over serial to my Arduino.

The error I'm getting doesn't really tell me anything, as far as I know anyway. Could it be because serial ports wouldn't work when run from an actual server? It works fine with Visual Studios server, and the XPS test that comes with Mono works fine with my Apache server.

I wanted to make this web page so my friend from across the country could send messages to my Arduino's LCD. :) Many thanks to anyone who can help me.

EDIT: After moving System.Web.Extensions.dll from Mono's folder to the bin folder, I get this error:

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 

Sometimes I get this error, sometimes the same one as before. Depends on Apache's mood I guess.


回答1:


That class is in System.Web.Extensions.dll, please make sure that DLL is in your bin folder.



来源:https://stackoverflow.com/questions/19401425/system-typeloadexception-with-mono-and-asp-net-in-arduino-project

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!