简体   繁体   中英

Unit tests failing only on the build server

It throws an exception that is something like this:

Initialization method MyAssemblyA.Initialize threw exception. 
Spring.Objects.Factory.ObjectCreationException: Spring.Objects.Factory.ObjectCreationException: 

Error thrown by a dependency of object 'messageSource' defined in 'assembly    
[MyOtherAssembly.Test, Version=1.1.1016.1, Culture=neutral, PublicKeyToken=null], 
resource [MyOtherAssembly.context.xml] 

line 256' : Initialization of object failed : Could not load file or assembly 'MyAssemblyB' 
or one of its dependencies. The system cannot find the file specified.

I don't know exactly why, but a lot of the unit tests are failing only on the build server and the exception that is thrown is something similar to what I wrote above.

In my context.xml I have something like this:

    <object name="messageSource" type="Spring.Context.Support.ResourceSetMessageSource, Spring.Core">
    <property name="resourceManagers">
      <list>
        <ref object="resMgrCoreServiceErrors"/>
        <ref object="resMgrPersonnelErrors"/>
      </list>
    </property>
  </object>

  <object name="resMgrCoreServiceErrors"
          type="Spring.Objects.Factory.Config.ResourceManagerFactoryObject, Spring.Core">
    <property name="baseName" value="MyOtherAssembly.Resources.ErrorRes"/>
    <property name="assemblyName" value="MyOtherAssembly"/>
  </object>

  <object name="resMgrPersonnelErrors"
          type="Spring.Objects.Factory.Config.ResourceManagerFactoryObject, Spring.Core">
    <property name="baseName" value="MyOtherAssemblyB.Resources.ErrorRes"/>
    <property name="assemblyName" value="MyOtherAssemblyB"/>
  </object>

where ErrorRes is a resource file (.resx).

Please help, any suggestions are welcomed !

are all of the dependencies of MyAssemblyB either installed in the gac or in the bin? has to be something in that vein.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM