首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >通过使用单声道的centos上的异常执行LitJson

通过使用单声道的centos上的异常执行LitJson
EN

Stack Overflow用户
提问于 2013-01-07 18:39:04
回答 1查看 500关注 0票数 1

我为centos编译了mono源代码(使用./configure,make,make install),看起来还不错。

代码语言:javascript
复制
mono --version
Mono JIT compiler version 2.10.9 (tarball 2013年 01月 02日 星期三 13:43:05 CST)
Copyright (C) 2002-2011 Novell, Inc, Xamarin, Inc and Contributors. www.mono-project.com
    TLS:           __thread
    SIGSEGV:       altstack
    Notifications: epoll
    Architecture:  x86
    Disabled:      none
    Misc:          softdebug 
    LLVM:          supported, not enabled.
    GC:            Included Boehm (with typed GC and Parallel Mark)

但是,当我尝试运行一个调用LitJson的.ashx文件时,我得到了

代码语言:javascript
复制
<p><strong>Description: </strong>HTTP 500. Error processing request.</p>
<p><strong>Stack Trace: </strong></p><table summary="Stack Trace" class="sampleCode">
<tr><td><pre>System.MissingMethodException: Method not found: 'System.Reflection.MethodInfo.op_Inequality'.
  at LitJson.JsonMapper.ToObject (System.Type type, System.String json) [0x00000] in &lt;filename unknown&gt;:0 
  at MobiusServer.Login..ctor (System.String jsondata) [0x00000] in &lt;filename unknown&gt;:0 
  at MobiusServer.MobiusHandler.ProcessRequest (System.Web.HttpContext context) [0x00000] in &lt;filename unknown&gt;:0 
  at System.Web.HttpApplication+&lt;Pipeline&gt;c__Iterator3.MoveNext () [0x00000] in &lt;filename unknown&gt;:0 
  at System.Web.HttpApplication.Tick () [0x00000] in &lt;filename unknown&gt;:0 </pre></td></tr>
</table>
<hr style="color: silver"/><strong>Version information: </strong> Mono Runtime Version: <tt>2.10.9 (tarball 2013/01/02 Wed 13:43:05 CST)</tt>; ASP.NET Version: <tt>2.0.50727.1433</tt></body></html>

<!--
[System.MissingMethodException]: Method not found: 'System.Reflection.MethodInfo.op_Inequality'.
  at LitJson.JsonMapper.ToObject (System.Type type, System.String json) [0x00000] in <filename unknown>:0 
  at MobiusServer.Login..ctor (System.String jsondata) [0x00000] in <filename unknown>:0 
  at MobiusServer.MobiusHandler.ProcessRequest (System.Web.HttpContext context) [0x00000] in <filename unknown>:0 
  at System.Web.HttpApplication+<Pipeline>c__Iterator3.MoveNext () [0x00000] in <filename unknown>:0 
  at System.Web.HttpApplication.Tick () [0x00000] in <filename unknown>:0 
-->

我可以在我的mac os x上运行同样的程序,它也安装了mono 2.10.9运行时。我是不是做错了什么或者错过了什么?谢谢!!

EN

回答 1

Stack Overflow用户

发布于 2013-01-08 18:09:27

经过一整天的研究,我发现mod_mono将使用.NET 2.0(mod-mono-server)来编译我的程序,但我的程序需要.NET 4.0

修改了下面的mod_mono.conf文件后,问题解决了!

代码语言:javascript
复制
# mod_mono.conf

# Achtung! This file may be overwritten
# Use 'include mod_mono.conf' from other configuration file
# to load mod_mono module.

<IfModule !mod_mono.c>
    LoadModule mono_module /usr/lib/httpd/modules/mod_mono.so
</IfModule>

<IfModule mod_headers.c>
    Header set X-Powered-By "Mono"
</IfModule>

MonoAutoApplication enabled
MonoDebug true
MonoServerPath "/etc/mono/bin/mod-mono-server4"
MonoUnixSocket "/tmp/.mod_mono"

AddType application/x-asp-net .aspx
AddType application/x-asp-net .asmx
AddType application/x-asp-net .ashx
AddType application/x-asp-net .asax
AddType application/x-asp-net .ascx
AddType application/x-asp-net .soap
AddType application/x-asp-net .rem
AddType application/x-asp-net .axd
AddType application/x-asp-net .cs
AddType application/x-asp-net .vb
AddType application/x-asp-net .master
AddType application/x-asp-net .sitemap
AddType application/x-asp-net .resources
AddType application/x-asp-net .skin
AddType application/x-asp-net .browser
AddType application/x-asp-net .webinfo
AddType application/x-asp-net .resx
AddType application/x-asp-net .licx
AddType application/x-asp-net .csproj
AddType application/x-asp-net .vbproj
AddType application/x-asp-net .config
AddType application/x-asp-net .Config
AddType application/x-asp-net .dll
DirectoryIndex index.aspx
DirectoryIndex Default.aspx
DirectoryIndex default.aspx
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/14194195

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档