仅记录日常开发中遇到的种种问题,供大家参考。
1、整理失败 原因:指定环境fat没有配置。
邮件找wdw进行环境配置。
2、调用接口提示环境为null
添加ReleaseInfo.config.info到web应用根目录。
3、Response.End()放在try...catch...中会抛出异常
try catch中使用Response.End()_已解决_博问_博客园 http://q.cnblogs.com/q/31506/
4、Request.QueryString["OrderID"] != null && !string.IsNullOrEmpty(Request.QueryString["OrderID"].Trim())
可使用??运算符优化,orderID = ( Request.QueryString["OrderID"] ?? string.Empty ).Trim();
?? 运算符称作 null 合并运算符。如果此运算符的左操作数不为 null,则此运算符将返回左操作数;否则返回右操作数。
5、The type or namespace name 'MySql' could not be found.
将MySQL的MySQL.Data.dll和MySQL.Web.dll拷贝到.netFramework目录下
The type or namespace name 'MySql' could not be found .net 连接 MySql时的错误 - simhare - 博客园
http://www.cnblogs.com/simhare/archive/2009/10/08/1579076.html
6、Failed to find or load the registered .Net Framework Data Provider.
mvc4.0链接MySQL数据库时的出现的问题,结果只是修改MySQL.Data.dll和MySQL.Web.dll的CopyLocal属性为True后就解决了。下文供参考
Failed to find or load the registered .Net Framework Data Provider - Tips and tricks from a Developer Support perspective. - Site Home - MSDN Blogs
http://blogs.msdn.com/b/spike/archive/2008/07/18/failed-to-find-or-load-the-registered-net-framework-data-provider.aspx
7、AutoMap类映射,使用中一直报错,错误信息"Trying to map xxx to xxx"
Exception of type 'AutoMapper.AutoMapperMappingException' was thrown.
经查找,发现确实是类型不一致导致的,map要求两边的类型必须完全一致,发现这个错误,要细心比对哦~
8、Collection was modified; enumeration operation may not execute.
检查后发现是使用Foreach...In语法体内运用了对Collection的Remove或Add导致的,只需要将foreach方法改为for方法即可。