自动映射器在调试模式下工作正常,但在发布模式下抛出mappingexception

问题描述 投票:1回答:2

自动映射器是一个很好的工具。 但我有一些问题。

在调试项目时,它可以正常运行,所有映射操作均成功。 但是在发布模式下,它会抛出具有完全相同数据的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.

 ....
c# automapper
2个回答
3
投票

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


0
投票

我们有同样的问题。 我们的问题是我们的服务器(发布)上的另一个版本的AutoMapper DLL。

© www.soinside.com 2019 - 2024. All rights reserved.