2015-06-19 19 views
1

我已经开始使用CoiniumServ代码。代码将在Windows上运行,但在我的Linux服务器上会失败。coiniumServ在Windows上运行,在运行时出现在单声道时出现System.Reflection.ReflectionTypeLoadException失败

堆栈跟踪:

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的经单(xbuild)建立在Linux中

回答

1

万一有人在搜索拉这件事,我张贴的答案。

在Linux上的单声道没有生成一堆.xml配置文件。

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

在Linux上构建输出相较于Windows上的构建输出显示丢失的文件。走容易的路线,我将文件从Windows复制到Linux并运行。

很高兴知道从纯粹的Linux POV到哪里寻找。如果我发现Linux构建说明中遗漏了什么,我会添加注释。

+0

在Windows上构建/运行后,出现此错误。应该有什么XML文件? – CryptoJones

相关问题