Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
277 views
in Technique[技术] by (71.8m points)

c# - System.TypeLoadException with Mono and ASP.NET in Arduino project

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.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...