2011-12-18 3 views
2

Mono에서 작은 MVC3 응용 프로그램을 호스팅 할 수 있지만 실제 사이트를 호스팅하려고 할 때 몇 가지 예외가 발생합니다.Mono에서 MVC3 응용 프로그램 호스팅

버전 :

  • 모노 면도기
  • 자 NHibernate를 사용 2.10.6
  • C# 4
  • MVC3 3.1.0.4
  • FluentNHibernate 1.2.0.712
  • MySql.Data 6.4. 4.0
  • MvcContrib 3.0.51.0

여기 Windows에서 xsp4을 실행하려고하는데 Linux에서 같은 오류가 발생합니다.

--verbose을 사용하여 추가 정보를 얻지 못했습니다. 아무도 왜이 오류가 발생하는지 또는 오류에 대한 추가 정보를 얻을 수있는 방법을 알고 있습니까?

 
Handling exception type TargetInvocationException 
Message is Exception has been thrown by the target of an invocation. 
IsTerminating is set to True 
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. 

Server stack trace: 
    at System.Reflection.MonoCMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000] in :0 
    at System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) [0x00000] in :0 
    at System.Runtime.Serialization.ObjectRecord.LoadData (System.Runtime.Serialization.ObjectManager manager, ISurrogateSelector selector, StreamingContext context) [0x00000] in :0 
    at System.Runtime.Serialization.ObjectManager.DoFixups() [0x00000] in :0 
    at System.Runtime.Serialization.Formatters.Binary.ObjectReader.ReadNextObject 
(System.IO.BinaryReader reader) [0x00000] in :0 
    at System.Runtime.Serialization.Formatters.Binary.ObjectReader.ReadObjectGraph (BinaryElement elem, System.IO.BinaryReader reader, Boolean readHeaders, System.Object& result, System.Runtime.Remoting.Messaging.Header[]& headers) [0x00000] 
in :0 
    at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.NoCheckDeserialize (System.IO.Stream serializationStream, System.Runtime.Remoting.Messaging.HeaderHandler handler) [0x00000] in :0 
    at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserialize 
(System.IO.Stream serializationStream) [0x00000] in :0 
    at System.Runtime.Remoting.RemotingServices.DeserializeCallData (System.Byte[] array) [0x00000] in :0 
    at (wrapper xdomain-dispatch) System.AppDomain:DoCallBack (object,byte[]&,byte[]&) 

Exception rethrown at [0]: 
---> System.ArgumentException: Couldn't bind to method 'SetHostingEnvironment'. 
    at System.Delegate.GetCandidateMethod (System.Type type, System.Type target, System.String method, BindingFlags bflags, Boolean ignoreCase, Boolean throwOnBindFailure) [0x00000] in :0 
    at System.Delegate.CreateDelegate (System.Type type, System.Type target, System.String method, Boolean ignoreCase, Boolean throwOnBindFailure) [0x00000] in :0 
    at System.Delegate.CreateDelegate (System.Type type, System.Type target, System.String method) [0x00000] in :0 
    at System.DelegateSerializationHolder+DelegateEntry.DeserializeDelegate (System.Runtime.Serialization.SerializationInfo info) [0x00000] in :0 
    at System.DelegateSerializationHolder..ctor (System.Runtime.Serialization.SerializationInfo info, StreamingContext ctx) [0x00000] in :0 
    at (wrapper managed-to-native) System.Reflection.MonoCMethod:InternalInvoke (System.Reflection.MonoCMethod,object,object[],System.Exception&) 
    at System.Reflection.MonoCMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000] in :0 
    --- End of inner exception stack trace --- 
    at (wrapper xdomain-invoke) System.AppDomain:DoCallBack (System.CrossAppDomainDelegate) 
    at (wrapper remoting-invoke-with-check) System.AppDomain:DoCallBack (System.CrossAppDomainDelegate) 
    at System.Web.Hosting.ApplicationHost.CreateApplicationHost (System.Type hostType, System.String virtualDir, System.String physicalDir) [0x00000] in :0 
    at Mono.WebServer.VPathToHost.CreateHost (Mono.WebServer.ApplicationServer server, Mono.WebServer.WebSource webSource) [0x00000] in :0 
    at Mono.WebServer.XSP.Server.RealMain (System.String[] args, Boolean root, IApplicationHost ext_apphost, Boolean quiet) [0x00000] in :0 
    at Mono.WebServer.XSP.Server.Main (System.String[] args) [0x00000] in :0 
[ERROR] FATAL UNHANDLED EXCEPTION: System.Reflection.TargetInvocationException: 
Exception has been thrown by the target of an invocation. 

Server stack trace: 
    at System.Reflection.MonoCMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000] in :0 
    at System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) [0x00000] in :0 
    at System.Runtime.Serialization.ObjectRecord.LoadData (System.Runtime.Serialization.ObjectManager manager, ISurrogateSelector selector, StreamingContext context) [0x00000] in :0 
    at System.Runtime.Serialization.ObjectManager.DoFixups() [0x00000] in :0 
    at System.Runtime.Serialization.Formatters.Binary.ObjectReader.ReadNextObject 
(System.IO.BinaryReader reader) [0x00000] in :0 
    at System.Runtime.Serialization.Formatters.Binary.ObjectReader.ReadObjectGraph (BinaryElement elem, System.IO.BinaryReader reader, Boolean readHeaders, System.Object& result, System.Runtime.Remoting.Messaging.Header[]& headers) [0x00000] 
in :0 
    at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.NoCheckDeserialize (System.IO.Stream serializationStream, System.Runtime.Remoting.Messaging.HeaderHandler handler) [0x00000] in :0 
    at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserialize 
(System.IO.Stream serializationStream) [0x00000] in :0 
    at System.Runtime.Remoting.RemotingServices.DeserializeCallData (System.Byte[] array) [0x00000] in :0 
    at (wrapper xdomain-dispatch) System.AppDomain:DoCallBack (object,byte[]&,byte[]&) 

Exception rethrown at [0]: 
---> System.ArgumentException: Couldn't bind to method 'SetHostingEnvironment'. 
    at System.Delegate.GetCandidateMethod (System.Type type, System.Type target, System.String method, BindingFlags bflags, Boolean ignoreCase, Boolean throwOnBindFailure) [0x00000] in :0 
    at System.Delegate.CreateDelegate (System.Type type, System.Type target, System.String method, Boolean ignoreCase, Boolean throwOnBindFailure) [0x00000] in :0 
    at System.Delegate.CreateDelegate (System.Type type, System.Type target, System.String method) [0x00000] in :0 
    at System.DelegateSerializationHolder+DelegateEntry.DeserializeDelegate (System.Runtime.Serialization.SerializationInfo info) [0x00000] in :0 
    at System.DelegateSerializationHolder..ctor (System.Runtime.Serialization.SerializationInfo info, StreamingContext ctx) [0x00000] in :0 
    at (wrapper managed-to-native) System.Reflection.MonoCMethod:InternalInvoke (System.Reflection.MonoCMethod,object,object[],System.Exception&) 
    at System.Reflection.MonoCMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000] in :0 
    --- End of inner exception stack trace --- 
    at (wrapper xdomain-invoke) System.AppDomain:DoCallBack (System.CrossAppDomainDelegate) 
    at (wrapper remoting-invoke-with-check) System.AppDomain:DoCallBack (System.CrossAppDomainDelegate) 
    at System.Web.Hosting.ApplicationHost.CreateApplicationHost (System.Type hostType, System.String virtualDir, System.String physicalDir) [0x00000] in :0 
    at Mono.WebServer.VPathToHost.CreateHost (Mono.WebServer.ApplicationServer server, Mono.WebServer.WebSource webSource) [0x00000] in :0 
    at Mono.WebServer.XSP.Server.RealMain (System.String[] args, Boolean root, IApplicationHost ext_apphost, Boolean quiet) [0x00000] in :0 
    at Mono.WebServer.XSP.Server.Main (System.String[] args) [0x00000] in :0 
+0

병렬 설치/GAC 문제일까요? 이 스레드를보십시오 : http://lists.ximian.com/pipermail/mono-list/2009-December/044136.html 그렇지 않으면 버그를 게시하십시오. –

답변

3

이유를 찾았습니다. 몇 가지 System.Web. * dll이 bin 폴더에 있습니다. 이것들을 제거하면 문제가 해결됩니다.

+0

중복되었거나 모든 system.web. * 파일을 bin에서 제거했다는 뜻입니까? – Chazt3n

+0

@ Chazt3n : 기억하지 마십시오. 이것은 1 년이 넘었습니다. – simendsjo

+0

괜찮습니다. 같은 오류가 발생했습니다. 그 이유는 아직 이해할 수 없습니다./ – Chazt3n

1

MVC 4/5에서도 문제가 지속됩니다. dll은 System.Web.dll입니다. 모노로 게시 할 때 삭제해야합니다.

1

Xamarin으로 Mvc 프로젝트를 생성하십시오. 필요한 dll은 bin 폴더에 있습니다. 그냥 잘 작동합니다.

관련 문제