[英]SpecFlow FeatureSetup throws System.Reflection.ReflectionTypeLoadException
[英]coiniumServ works on windows, fails on mono at runtime with System.Reflection.ReflectionTypeLoadException
我已經開始研究CoiniumServ代碼。 該代碼將在Windows上運行,但在我的Linux服務器上將失敗。
堆棧跟蹤:
Nancy.TinyIoc.TinyIoCResolutionException:
Unable to resolve type:
CoiniumServ.Server.Web.WebServer --->
Nancy.TinyIoc.TinyIoCResolutionException: Unable to resolve type:
CoiniumServ.Server.Web.NancyBootstrapper --->
System.TypeInitializationException: An exception was thrown by the type initializer for Nancy.Bootstrapper.AssemblyTypeScanner --->
System.Reflection.ReflectionTypeLoadException: The classes in the module cannot be loaded.
at (wrapper managed-to-native) System.Reflection.Assembly:GetTypes (System.Reflection.Assembly,bool)
at System.Reflection.Assembly.GetExportedTypes () [0x00000] in <filename unknown>:0
at Nancy.Extensions.AssemblyExtensions.SafeGetExportedTypes (System.Reflection.Assembly assembly) [0x00000] in <filename unknown>:0
at Nancy.Bootstrapper.AppDomainAssemblyTypeScanner.<UpdateTypes>b__16 (System.Reflection.Assembly assembly) [0x00000] in <filename unknown>:0
at System.Linq.Enumerable+<CreateSelectManyIterator>c__Iterator14`3[System.Reflection.Assembly,System.Type,<>f__AnonymousType0`2[System.Reflection.Assemb]].MoveNext () [0x00000] in <filename unknown>:0
at System.Linq.Enumerable+<CreateWhereIterator>c__Iterator1E`1[<>f__AnonymousType0`2[System.Reflection.Assembly,System.Type]].MoveNext () [0x00000] in <fn>:0
at System.Linq.Enumerable+<CreateSelectIterator>c__Iterator10`2[<>f__AnonymousType0`2[System.Reflection.Assembly,System.Type],System.Type].MoveNext () [0lename unknown>:0
at System.Linq.Enumerable.ToArray[Type] (IEnumerable`1 source) [0x00000] in <filename unknown>:0
at Nancy.Bootstrapper.AppDomainAssemblyTypeScanner.UpdateTypes () [0x00000] in <filename unknown>:0
at Nancy.Bootstrapper.AppDomainAssemblyTypeScanner.LoadAssembliesWithNancyReferences () [0x00000] in <filename unknown>:0
at Nancy.Bootstrapper.AppDomainAssemblyTypeScanner..cctor () [0x00000] in <filename unknown>:0
--- End of inner exception stack trace ---
at Nancy.Conventions.NancyConventions.BuildDefaultConventions () <0x0002f>
at Nancy.Conventions.NancyConventions..ctor () <0x00013>
at Nancy.Bootstrapper.NancyBootstrapperBase`1<Nancy.TinyIoc.TinyIoCContainer>..ctor () <0x0005f>
at Nancy.Bootstrapper.NancyBootstrapperWithRequestContainerBase`1<Nancy.TinyIoc.TinyIoCContainer>..ctor () <0x00087>
at Nancy.DefaultNancyBootstrapper..ctor () <0x00013>
at CoiniumServ.Server.Web.NancyBootstrapper..ctor (CoiniumServ.Container.Context.IApplicationContext,CoiniumServ.Statistics.IStatisticsManager,CoiniumServ.Pools.IPoolManager,CoiniumServ.Configuration.IConfigManager) <0x00033>
at (wrapper dynamic-method) object.lambda_method (System.Runtime.CompilerServices.Closure,object[]) <0x00357>
at Nancy.TinyIoc.TinyIoCContainer.ConstructType (System.Type,System.Type,System.Reflection.ConstructorInfo,Nancy.TinyIoc.NamedParameterOverloads,Nancy.TinyIoc.ResolveOptions) <0x003fe>
--- End of inner exception stack trace ---
at Nancy.TinyIoc.TinyIoCContainer.ConstructType (System.Type requestedType, System.Type implementationType, System.Reflection.ConstructorInfo constructor, Nancy.TinyIoc.NamedParameterOverloads parameters, Nancy.TinyIoc.ResolveOptions options) [0x00000] in <filename unknown>:0
at Nancy.TinyIoc.TinyIoCContainer.ConstructType (System.Type requestedType, System.Type implementationType, System.Reflection.ConstructorInfo constructor, Nancy.TinyIoc.ResolveOptions options) [0x00000] in <filename unknown>:0
at Nancy.TinyIoc.TinyIoCContainer+SingletonFactory.GetObject (System.Type requestedType, Nancy.TinyIoc.TinyIoCContainer container, Nancy.TinyIoc.NamedParameterOverloads parameters, Nancy.TinyIoc.ResolveOptions options) [0x00000] in <filename unknown>:0
at Nancy.TinyIoc.TinyIoCContainer.ResolveInternal (Nancy.TinyIoc.TypeRegistration registration, Nancy.TinyIoc.NamedParameterOverloads parameters, Nancy.TinyIoc.ResolveOptions options) [0x00000] in <filename unknown>:0
--- End of inner exception stack trace ---
at Nancy.TinyIoc.TinyIoCContainer.ConstructType (System.Type requestedType, System.Type implementationType, System.Reflection.ConstructorInfo constructor, Nancy.TinyIoc.NamedParameterOverloads parameters, Nancy.TinyIoc.ResolveOptions options) [0x00000] in <filename unknown>:0
at Nancy.TinyIoc.TinyIoCContainer.ConstructType (System.Type requestedType, System.Type implementationType, System.Reflection.ConstructorInfo constructor, Nancy.TinyIoc.ResolveOptions options) [0x00000] in <filename unknown>:0
at Nancy.TinyIoc.TinyIoCContainer+SingletonFactory.GetObject (System.Type requestedType, Nancy.TinyIoc.TinyIoCContainer container, Nancy.TinyIoc.NamedParameterOverloads parameters, Nancy.TinyIoc.ResolveOptions options) [0x00000] in <filename unknown>:0
at Nancy.TinyIoc.TinyIoCContainer.ResolveInternal (Nancy.TinyIoc.TypeRegistration registration, Nancy.TinyIoc.NamedParameterOverloads parameters, Nancy.TinyIoc.ResolveOptions options) [0x00000] in <filename unknown>:0
文件/類包含在構建文件中,並在編譯過程中列出。 在編譯過程中會拋出一些警告,但僅針對代碼中一些未使用的變量。 我檢查了引用的dll是否都已復制。 我還嘗試過刪除nuget提取的軟件包,並在構建之前運行手動清理。
我不是真正的C#人員,所以我不確定從這里去哪里。
[編輯] Windows版本是使用VisualStudio構建的,Linux是通過mono(xbuild)在Linux機器上構建的
以防萬一有人在搜索中提出該問題,我正在發布答案。
Linux構建上的mono不會生成一堆.xml配置文件。
這個答案向我指出了正確的方向: http : //forum.unity3d.com/threads/ideas-reflectiontypeloadexception-the-classes-in-the-module-cannot-be-loaded.230389/
將Linux上的生成輸出與Windows上的生成輸出進行比較,顯示出缺少的文件。 走的很簡單,我將文件從Windows復制到Linux,然后運行。
最好知道從純Linux POV看哪里。 如果發現Linux構建說明中遺漏的內容,我將添加注釋。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.