2011-12-18 7 views
2

私はMonoで小さなMVC3アプリケーションをホストできますが、実際のサイトをホストしようとするといくつかの例外が発生します。MonoでMVC3アプリケーションをホストする

バージョン:

  • モノ2.10.6
  • カミソリ
  • を使用してC#4
  • MVC3 NHibernateは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

重複しているか、あなたのbinからすべてのsystem.web。*ファイルを削除しただけですか? – Chazt3n

+0

@ Chazt3n:覚えていない。これは1年以上前です:) – simendsjo

+0

問題はありません。同じエラーが発生しています。理由はまだわかりません。/ – Chazt3n

1

MVC 4/5でも問題は解決しません。 dllはSystem.Web.dllです。モノに公開するときは削除する必要があります。

1

XamarinでMvcプロジェクトを作成します。あなたが必要とするDLLはbinフォルダにあります。