首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >使用System.Reflection.ReflectionTypeLoadException时,coiniumServ可以在windows上运行,在单声道上运行失败

使用System.Reflection.ReflectionTypeLoadException时,coiniumServ可以在windows上运行,在单声道上运行失败
EN

Stack Overflow用户
提问于 2015-06-20 01:42:24
回答 1查看 361关注 0票数 1

我已经开始编写CoiniumServ代码了。代码可以在windows上运行,但在我的Linux服务器上运行失败。

堆栈跟踪:

代码语言:javascript
复制
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机器上构建的。

EN

回答 1

Stack Overflow用户

发布于 2015-06-22 22:03:53

以防有人在搜索中找到这个,我把答案贴出来。

mono on linux build没有生成一堆.xml配置文件。

这个答案给我指明了正确的方向:http://forum.unity3d.com/threads/ideas-reflectiontypeloadexception-the-classes-in-the-module-cannot-be-loaded.230389/

将linux上的构建输出与Windows上的构建输出进行比较,会发现缺少的文件。通过简单的方法,我将文件从Windows复制到Linux上,然后它就运行了。

如果知道从纯Linux POV中查看哪些内容,那将是件好事。如果我发现Linux构建说明中遗漏了什么,我会添加注释。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/30944223

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档