automapper在调试模式下运行良好,但在发布模式下抛出mappingexception

本文关键字:模式 布模式 mappingexception 运行 调试 automapper | 更新日期: 2023-09-27 18:19:37

Automapper是一个很好的工具。但是我有一些问题。

在调试项目时,它运行良好,所有映射操作都成功。但在发布模式下,它会抛出具有完全相同数据的mappingexception。

问题出在哪里?

我的环境是Win7,32位,VS 2010。项目在.net 4.0配置文件上运行。

 Mapper.CreateMap<V_Person_Details,Person>();
 Mapper.Map(curr_V_Person, cur_Person); /// exception throws here in just release mode , not in debug mode 
   ///Trying to map System.String to System.nullable .... Destination property  SSS_ID : exception of the Automapper.AutomapperMappingException was thrown.
 ....

automapper在调试模式下运行良好,但在发布模式下抛出mappingexception

在调试模式下运行Mapper.AssertConfigurationIsValid()方法,以验证您没有任何只在发布模式下显示的配置错误。

我们遇到了同样的问题。对我们来说,问题是我们的服务器上的另一个版本的AutoMapper dll(发布版)。