我为我的应用程序创建了一个测试用例。当我在本地运行时,所有测试工作正常。 当我设置一个构建以在TFS中每天早上运行所有测试时,我得到以下错误。
错误消息如下所示。
Class Initialization method RightsLine.Test.MockTest.CRUDCharacteristicTemplateTest.Setup threw exception. AutoMapper.AutoMapperConfigurationException: AutoMapper.AutoMapperConfigurationException:
The following property on System.Int32 cannot be mapped: <PROPERTY>
Add a custom mapping expression, ignore, add a custom resolver, or modify the destination type System.Int32.
Context:
Mapping to property <PROPERTY> from System.Byte to System.Int32
Mapping from type <CLASS_A> to <CLASS_B>
Exception of type 'AutoMapper.AutoMapperConfigurationException' was thrown..`enter code here`
错误堆栈跟踪看起来像这样。
AutoMapper.ConfigurationStore.DryRunTypeMap(ICollection`1 typeMapsChecked, ResolutionContext context)
AutoMapper.ConfigurationStore.DryRunTypeMap(ICollection`1 typeMapsChecked, ResolutionContext context)
AutoMapper.ConfigurationStore.AssertConfigurationIsValid(IEnumerable`1 typeMaps)
AutoMapper.ConfigurationStore.AssertConfigurationIsValid()
AutoMapper.Mapper.AssertConfigurationIsValid()
为什么DryRunTypeMap在运行测试版本时会抛出错误,而在我从本地执行时却不会抛出错误。 任何帮助将不胜感激。
感谢。