Excel导入遇到的问题An object with the same key already exists in the ObjectStateManager……

我再导入excel的时候,在本地上是好好的,但是部署之后就不对了。

开始以为是路径可能出错,然后特意跟踪了路径发现没问题,

后面写了很多日志记录发现下面那异常:

An object with the same key already exists in the ObjectStateManager. The existing object is in the Unchanged state. An object can only be added to the ObjectStateManager again if it is in the added state.

网速求助之后才知道是因为部署服务器是64位的,而这程序是32位的,所以需要在IIS中应用池中启用32位程序,

这样就可以解决这问题。

posted on 2014-08-08 08:42  翔游九天  阅读(467)  评论(0编辑  收藏  举报