我試圖在ubuntu中使用mono來運行我自己託管的servicestack控制檯應用程序。ServiceStack自身主機應用System.TypeloadException當在Ubuntu中使用mono時
我只是試圖在我的Ubuntu服務器上運行mono時遇到這個問題。該應用程序在Windows環境中工作正常。
當我嘗試用mono appname.exe
我碰到下面的錯誤開始我的應用程序:
System.TypeLoadException: Could not load type 'Api.Database.MySqlConnection' from assembly 'Api, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'.
at (wrapper managed-to-native) System.Type:type_is_assignable_from (System.Type,System.Type)
at System.Type.IsAssignableFrom (System.Type c) [0x00000] in <filename unknown>:0
at ServiceStack.ServiceHost.ServiceController.RegisterNService (ITypeFactory serviceFactoryFn, System.Type serviceType) [0x00000] in <filename unknown>:0
at ServiceStack.ServiceHost.ServiceController.Register (ITypeFactory serviceFactoryFn) [0x00000] in <filename unknown>:0
at ServiceStack.ServiceHost.ServiceManager.Init() [0x00000] in <filename unknown>:0
at ServiceStack.WebHost.Endpoints.Support.HttpListenerBase.Init() [0x00000] in <filename unknown>:0
at UniBooks_Api_Runner.Program.Main (System.String[] args) [0x00000] in <filename unknown>:0
單使用此框其他應用程序工作正常,我,所以我不會那麼自信了單問題 - 也許與一些服務堆棧的東西單聲道衝突?
的特定類頂部的錯誤引用使用以下組件:
using System;
using System.Data;
using MySql.Data.MySqlClient;
此類還實現System.Data.IDbConnection
和IM也使用.NET Framework 4.5
我還想指出的是,我有通過閱讀this answer和this tutorial並且我參考了Mono.Unix
程序集,調整了linux/ubuntu的控制檯應用程序,所以我不認爲應用程序自我託管方式存在問題。
有沒有人提出過這個問題或此類問題?你能幫助我理解這個問題,也許可以在哪裏尋找解決方案。
感謝
非常感謝你的幫助。我錯過了一個裝配。最有用的信息。再次感謝 – steve