我可以用手来弄清楚我的mono + mod-mono + MVC设置有什么问题:
我正在尝试将我的Asp.Net MVC3站点部署在运行在CentOS 6.5上的Apache服务器上。我想我的单声道3.10.1安装工作正常,因为我可以通过在Linux平台上发出mono myprogram.exe来运行C#控制台程序。此外,我已配置mod_mono(3.8),我可以访问简单的Web应用程序。我已经测试了一个简单的aspx页面打印出当前日期,只是为了看到我的Apache和mod_mono实际上正在正确通信。
但是当我尝试部署MVC3网站时出现问题。当尝试在浏览器上访问它时,我得到500错误,httpd / error_log说:
Stacktrace:
at <unknown> <0xffffffff>
at (wrapper managed-to-native) System.Reflection.Assembly.GetTypes (System.Reflection.Assembly,bool) <0xffffffff>
at System.Reflection.Assembly.GetTypes () <0x00018>
at Mono.CSharp.ReflectionImporter.ImportAssembly (System.Reflection.Assembly,Mono.CSharp.RootNamespace) <0x00037>
at Microsoft.CSharp.RuntimeBinder.DynamicContext.Create () <0x00223>
at Microsoft.CSharp.RuntimeBinder.CSharpSetMemberBinder.FallbackSetMember (System.Dynamic.DynamicMetaObject,System.Dynamic.DynamicMetaObject,System.Dynamic.DynamicMetaObject) <0x00013>
at System.Dynamic.DynamicObject/MetaDynamic/<BindSetMember>c__AnonStorey1.<>m__0 (System.Dynamic.DynamicMetaObject) <0x0001c>
at System.Dynamic.DynamicObject/MetaDynamic.CallMethodReturnLast (string,System.Dynamic.DynamicMetaObjectBinder,System.Linq.Expressions.Expression[],System.Linq.Expressions.Expression,System.Dynamic.DynamicObject/MetaDynamic/Fallback) <0x00012>
at System.Dynamic.DynamicObject/MetaDynamic.BindSetMember (System.Dynamic.SetMemberBinder,System.Dynamic.DynamicMetaObject) <0x0014b>
at System.Dynamic.SetMemberBinder.Bind (System.Dynamic.DynamicMetaObject,System.Dynamic.DynamicMetaObject[]) <0x0007a>
at System.Dynamic.DynamicMetaObjectBinder.Bind (object[],System.Collections.ObjectModel.ReadOnlyCollection`1<System.Linq.Expressions.ParameterExpression>,System.Linq.Expressions.LabelTarget) <0x00155>
at System.Runtime.CompilerServices.CallSiteBinder.BindCore<T> (System.Runtime.CompilerServices.CallSite`1<T>,object[]) <0x00090>
at System.Dynamic.UpdateDelegates.UpdateAndExecute2<T0, T1, TRet> (System.Runtime.CompilerServices.CallSite,T0,T1) <0x0040f>
at BoaCommander.Controllers.HomeController.Index () <0x000e8>
at (wrapper dynamic-method) object.lambda_method (System.Runtime.CompilerServices.Closure,System.Web.Mvc.ControllerBase,object[]) <0x0002f>
at System.Web.Mvc.ActionMethodDispatcher.Execute (System.Web.Mvc.ControllerBase,object[]) <0x0001b>
at System.Web.Mvc.ReflectedActionDescriptor.Execute (System.Web.Mvc.ControllerContext,System.Collections.Generic.IDictionary`2<string, object>) <0x0016f>
at System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod (System.Web.Mvc.ControllerContext,System.Web.Mvc.ActionDescriptor,System.Collections.Generic.IDictionary`2<string, object>) <0x00019>
at System.Web.Mvc.ControllerActionInvoker/<>c__DisplayClass15.<InvokeActionMethodWithFilters>b__12 () <0x00066>
at System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodFilter (System.Web.Mvc.IActionFilter,System.Web.Mvc.ActionExecutingContext,System.Func`1<System.Web.Mvc.ActionExecutedContext>) <0x000dc>
at System.Web.Mvc.ControllerActionInvoker/<>c__DisplayClass15/<>c__DisplayClass17.<InvokeActionMethodWithFilters>b__14 () <0x0001f>
at System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodWithFilters (System.Web.Mvc.ControllerContext,System.Collections.Generic.IList`1<System.Web.Mvc.IActionFilter>,System.Web.Mvc.ActionDescriptor,System.Collections.Generic.IDictionary`2<string, object>) <0x00250>
at System.Web.Mvc.ControllerActionInvoker.InvokeAction (System.Web.Mvc.ControllerContext,string) <0x0015a>
at System.Web.Mvc.Controller.ExecuteCore () <0x00064>
at System.Web.Mvc.ControllerBase.Execute (System.Web.Routing.RequestContext) <0x0005f>
at System.Web.Mvc.ControllerBase.System.Web.Mvc.IController.Execute (System.Web.Routing.RequestContext) <0x00016>
at System.Web.Mvc.MvcHandler/<>c__DisplayClass6/<>c__DisplayClassb.<BeginProcessRequest>b__5 () <0x00026>
at System.Web.Mvc.Async.AsyncResultWrapper/<>c__DisplayClass1.<MakeVoidDelegate>b__0 () <0x00015>
at (wrapper delegate-invoke) System.Func`1<System.Web.Mvc.Async.AsyncVoid>.invoke_TResult () <0xffffffff>
at System.Web.Mvc.Async.AsyncResultWrapper/<>c__DisplayClass8`1<System.Web.Mvc.Async.AsyncVoid>.<BeginSynchronous>b__7 (System.IAsyncResult) <0x00019>
at (wrapper delegate-invoke) System.Web.Mvc.Async.EndInvokeDelegate`1<System.Web.Mvc.Async.AsyncVoid>.invoke_TResult_IAsyncResult (System.IAsyncResult) <0xffffffff>
at System.Web.Mvc.Async.AsyncResultWrapper/WrappedAsyncResult`1<System.Web.Mvc.Async.AsyncVoid>.End () <0x0006f>
at System.Web.Mvc.Async.AsyncResultWrapper.End<System.Web.Mvc.Async.AsyncVoid> (System.IAsyncResult,object) <0x00027>
at System.Web.Mvc.Async.AsyncResultWrapper.End (System.IAsyncResult,object) <0x00017>
at System.Web.Mvc.MvcHandler/<>c__DisplayClasse.<EndProcessRequest>b__d () <0x0001b>
at System.Web.Mvc.SecurityUtil.<GetCallInAppTrustThunk>b__0 (System.Action) <0x00011>
at System.Web.Mvc.SecurityUtil.ProcessInApplicationTrust (System.Action) <0x00018>
at System.Web.Mvc.MvcHandler.EndProcessRequest (System.IAsyncResult) <0x000b3>
at System.Web.Mvc.MvcHandler.System.Web.IHttpAsyncHandler.EndProcessRequest (System.IAsyncResult) <0x00016>
at System.Web.HttpApplication.async_handler_complete_cb (System.IAsyncResult) <0x000d1>
at System.Web.Mvc.Async.AsyncResultWrapper/WrappedAsyncResult`1<System.Web.Mvc.Async.AsyncVoid>.Begin (System.AsyncCallback,object,int) <0x0016a>
at System.Web.Mvc.Async.AsyncResultWrapper.BeginSynchronous<System.Web.Mvc.Async.AsyncVoid> (System.AsyncCallback,object,System.Func`1<System.Web.Mvc.Async.AsyncVoid>,object) <0x0012b>
at System.Web.Mvc.Async.AsyncResultWrapper.BeginSynchronous (System.AsyncCallback,object,System.Action,object) <0x00027>
at System.Web.Mvc.MvcHandler/<>c__DisplayClass6.<BeginProcessRequest>b__2 () <0x00333>
at System.Web.Mvc.SecurityUtil/<>c__DisplayClassb`1.<ProcessInApplicationTrust>b__a () <0x00018>
at System.Web.Mvc.SecurityUtil.<GetCallInAppTrustThunk>b__0 (System.Action) <0x00011>
at System.Web.Mvc.SecurityUtil.ProcessInApplicationTrust (System.Action) <0x00018>
at System.Web.Mvc.SecurityUtil.ProcessInApplicationTrust<TResult> (System.Func`1<TResult>) <0x00117>
at System.Web.Mvc.MvcHandler.BeginProcessRequest (System.Web.HttpContextBase,System.AsyncCallback,object) <0x00137>
at System.Web.Mvc.MvcHandler.BeginProcessRequest (System.Web.HttpContext,System.AsyncCallback,object) <0x0003f>
at System.Web.Mvc.MvcHandler.System.Web.IHttpAsyncHandler.BeginProcessRequest (System.Web.HttpContext,System.AsyncCallback,object) <0x00019>
at System.Web.HttpApplication/<Pipeline>c__Iterator1.MoveNext () <0x037f7>
at System.Web.HttpApplication.Tick () <0x00035>
at System.Web.HttpApplication.Start (object) <0x001a3>
at System.Web.HttpApplication.System.Web.IHttpHandler.ProcessRequest (System.Web.HttpContext) <0x00057>
at System.Web.HttpRuntime.Process (System.Web.HttpWorkerRequest) <0x00223>
at System.Web.HttpRuntime.RealProcessRequest (object) <0x0007b>
at System.Web.HttpRuntime.ProcessRequest (System.Web.HttpWorkerRequest) <0x00043>
at Mono.WebServer.MonoWorkerRequest.ProcessRequest () <0x00083>
at Mono.WebServer.BaseApplicationHost.ProcessRequest (Mono.WebServer.MonoWorkerRequest) <0x00073>
at Mono.WebServer.ModMonoApplicationHost.ProcessRequest (int,string,string,string,string,string,int,string,int,string,string[],string[],object) <0x003ef>
at (wrapper remoting-invoke-with-check) Mono.WebServer.ModMonoApplicationHost.ProcessRequest (int,string,string,string,string,string,int,string,int,string,string[],string[],object) <0xffffffff>
at (wrapper xdomain-dispatch) Mono.WebServer.ModMonoApplicationHost.ProcessRequest (object,byte[]&,byte[]&,int,string,string,string,string,string,int,string,int,string,string[],string[]) <0xffffffff>
at (wrapper xdomain-invoke) Mono.WebServer.ModMonoApplicationHost.ProcessRequest (int,string,string,string,string,string,int,string,int,string,string[],string[],object) <0xffffffff>
at (wrapper remoting-invoke-with-check) Mono.WebServer.ModMonoApplicationHost.ProcessRequest (int,string,string,string,string,string,int,string,int,string,string[],string[],object) <0xffffffff>
at Mono.WebServer.Apache.ModMonoWorker.InnerRun () <0x006e3>
at Mono.WebServer.Apache.ModMonoWorker.Run (object) <0x0001b>
at (wrapper runtime-invoke) <Module>.runtime_invoke_void__this___object (object,intptr,intptr,intptr) <0xffffffff>
Native stacktrace:
/usr/bin/mono() [0x80f1342]
[0xb76f4600]
Debug info from gdb:
warning: File "/usr/bin/mono-sgen-gdb.py" auto-loading has been declined by your `auto-load safe-path' set to "/usr/share/gdb/auto-load:/usr/lib/debug:/usr/bin/mono-gdb.py".
To enable execution of this file add
add-auto-load-safe-path /usr/bin/mono-sgen-gdb.py
line to your configuration file "$HOME/.gdbinit".
To completely disable this security protection add
set auto-load safe-path /
line to your configuration file "$HOME/.gdbinit".
For more information about this security protection see the
"Auto-loading safe path" section in the GDB manual. E.g., run from the shell:
info "(gdb)Auto-loading safe path"
[New LWP 2106]
[New LWP 2105]
[New LWP 2101]
...
Thread 1 (Thread 0xb74fa700 (LWP 2087)):
#0 0xb76f4405 in __kernel_vsyscall ()
#1 0xb769d3ac in pthread_cond_wait@@GLIBC_2.3.2 () from /lib/libpthread.so.0
#2 0x0825106f in _wapi_handle_timedwait_signal_handle (handle=0x400, timeout=0x0, alertable=1, poll=0) at handles.c:1595
#3 0x08251167 in _wapi_handle_wait_signal (poll=0) at handles.c:1528
#4 0x082654c6 in WaitForMultipleObjectsEx (numobjects=2, handles=0xbfece7dc, waitall=0, timeout=4294967295, alertable=1) at wait.c:637
#5 0x081c9201 in wait_for_tids_or_state_change () at threads.c:2718
#6 mono_thread_manage () at threads.c:2921
#7 0x080c7caf in mono_main (argc=8, argv=0xbfecebb4) at driver.c:2021
#8 0x08057c83 in mono_main_with_options (argc=8, argv=0xbfecebb4) at main.c:91
#9 main (argc=8, argv=0xbfecebb4) at main.c:122
=================================================================
Got a SIGABRT while executing native code. This usually indicates
a fatal error in the mono runtime or one of the native libraries
used by your application.
=================================================================
[Thu Oct 30 16:17:26 2014] [error] (70014)End of file found: read_data failed
[Thu Oct 30 16:17:26 2014] [error] Command stream corrupted, last command was 1
所以,根据警告,我创建了一个文件/root/.gdbinit并添加了一行: add-auto-load-safe-path /usr/bin/mono-sgen-gdb.py
没效果。我验证了mono-gdb.py和mono-sgen-gdb.py文件存在,也尝试仅添加文件夹:add-auto-load-safe-path / usr / bin / - 再没有效果。尝试运行gdb并在gdb上发出命令'add-auto-load-safe-path /usr/bin/mono-sgen-gdb.py' - 没有效果。所以我必须有一些我做错了,或者我的设置有问题。
知道这可能是什么以及我应该在哪里继续寻找解决方案?