出现这个异常是因为使用了类似COM组件的关系。使用了水晶报表也会出现这种情况。都是在本机上调试没问题,发布后出现的问题。
权限问题 解决方法有几种 第1种.给asp.net帐号分配好访问com的权限,配置好com+
第2种.在web.config的system.web节加入 <identity impersonate="true" userName="具有管理员权限的帐号名" password="相应的密码"/>
来模拟一个具有管理权限的身份来运行你的代码,或者 <identity impersonate="false">,去掉这个节点也可以