简体   繁体   English

coiniumServ在Windows上运行,在单声道运行时出现System.Reflection.ReflectionTypeLoadException失败。

[英]coiniumServ works on windows, fails on mono at runtime with System.Reflection.ReflectionTypeLoadException

I've started working on CoiniumServ code. 我已经开始研究CoiniumServ代码。 The code will run on windows, but on my Linux server it fails. 该代码将在Windows上运行,但在我的Linux服务器上将失败。

Stack Trace: 堆栈跟踪:

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

The files/classes are included in the build file and listed during compile. 文件/类包含在构建文件中,并在编译过程中列出。 There are a couple of warning thrown during the compile,but only in reference to some unused variables in the code. 在编译过程中会抛出一些警告,但仅针对代码中一些未使用的变量。 I've checked that the referenced dll's are all being copied. 我检查了引用的dll是否都已复制。 I've also tried deleting packages pulled by nuget, and running a manual clean before the build. 我还尝试过删除nuget提取的软件包,并在构建之前运行手动清理。

I'm not really a C# person, so I'm not sure where to go from here. 我不是真正的C#人员,所以我不确定从这里去哪里。

[Edit] The windows version was build with VisualStudio, the linux was built on the Linux box via mono ( xbuild ) [编辑] Windows版本是使用VisualStudio构建的,Linux是通过mono(xbuild)在Linux机器上构建的

Just in case anyone pulls this up in a search, I'm posting the answer. 以防万一有人在搜索中提出该问题,我正在发布答案。

The mono on linux build was not generating a bunch of .xml configuration files. Linux构建上的mono不会生成一堆.xml配置文件。

This answer pointed me in the right direction: http://forum.unity3d.com/threads/ideas-reflectiontypeloadexception-the-classes-in-the-module-cannot-be-loaded.230389/ 这个答案向我指出了正确的方向: http : //forum.unity3d.com/threads/ideas-reflectiontypeloadexception-the-classes-in-the-module-cannot-be-loaded.230389/

Comparing the build output on linux to the build output on Windows showed the missing files. 将Linux上的生成输出与Windows上的生成输出进行比较,显示出缺少的文件。 Going the easy route, I copied the files from Windows up to Linux and it ran. 走的很简单,我将文件从Windows复制到Linux,然后运行。

It would be good to know where to look from a pure Linux POV. 最好知道从纯Linux POV看哪里。 I'll add comments if I find what gets left out in the Linux build instructions. 如果发现Linux构建说明中遗漏的内容,我将添加注释。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 SpecFlow FeatureSetup引发System.Reflection.ReflectionTypeLoadException - SpecFlow FeatureSetup throws System.Reflection.ReflectionTypeLoadException Windows服务:抛出System.Reflection.ReflectionTypeLoadException并显示以下错误消息:无法加载一个或多个re - Windows Service: System.Reflection.ReflectionTypeLoadException was thrown with the following error message: Unable to load one or more of the re 未处理的异常:Unity3d中的System.Reflection.ReflectionTypeLoadException - Unhandled Exception: System.Reflection.ReflectionTypeLoadException in Unity3d 获取程序集中的类型(错误:System.Reflection.ReflectionTypeLoadException) - Get Types in assembly (error: System.Reflection.ReflectionTypeLoadException) C# - 动态加载 DLL - System.Reflection.ReflectionTypeLoadException:无法加载一种或多种请求的类型 - C# - Loading DLL Dynamic - System.Reflection.ReflectionTypeLoadException: Unable to load one or more of the requested types 添加显示未处理的异常的Emgu.CV.World dll时:System.Reflection.ReflectionTypeLoadException - On Adding Emgu.CV.World dll showing Unhandled Exception: System.Reflection.ReflectionTypeLoadException 使用Sybase时AppDomain.CurrentDomain.GetAssemblies()引发System.Reflection.ReflectionTypeLoadException - AppDomain.CurrentDomain.GetAssemblies() throws System.Reflection.ReflectionTypeLoadException when using Sybase MahApps DLL的Reflection.ReflectionTypeLoadException - Reflection.ReflectionTypeLoadException for MahApps DLL 在ARM(i.MX6)上构建时,Mono system.windows.forms无法通过测试 - Mono system.windows.forms fails tests when building on ARM (i.MX6) MSBuildWorkspace.Create在单声道上抛出ReflectionTypeLoadException - MSBuildWorkspace.Create on mono throws ReflectionTypeLoadException
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM