摘要: 注: 转自http://www.cnblogs.com/liping13599168/archive/2011/02/23/1962625.html今天看到一篇文章(构建ASP.NET网站十大必备工具(2)),里面介绍了一个ELMAH的错误日志工具,于是研究了一下。 ELMAH 是 Error Lo... 阅读全文
posted @ 2014-11-03 16:52 Vic.Zhang 阅读(467) 评论(0) 推荐(0)
摘要: 注:转自http://blog.chinaunix.net/uid-576762-id-2733753.html 有时我们在运行程序时,会出现Debug版本和Release版本运行结果不一致的情况。现给出C#中的一个例子,这个例子是Jeffrey在他的《CLR via C#》中"垃圾回收"这一章给出的,很有意思。 其实大家也会猜测,Debug版和Release版编译后的代码肯定会有不一样的地方,是的!是会这样的。要不然也不会出现运行结果不一致,呵呵!闲话不说我们来看看代码,代码很简单。(调试环境WinXP + VS2003 + C#)classProgram{[STAThr 阅读全文
posted @ 2013-10-11 20:52 Vic.Zhang 阅读(288) 评论(0) 推荐(0)
摘要: There are three 'contexts' for assembly binding:Load contextIn general, if the assembly was found by probing in the GAC, a host assembly store (if hosted), or the ApplicationBase / PrivateBinPaths of the AppDomain, the assembly will be loaded in the Load context.LoadFrom contextIn general, i 阅读全文
posted @ 2013-08-21 22:07 Vic.Zhang 阅读(165) 评论(0) 推荐(0)
摘要: 一些关于C#反射的知识,估计也就最多达到使用API的程度,至于要深入了解,以现在的水平估计很难做到,所以下面此篇文章,以作为一个阶段的总结。对于反射的总结,我想从以下几个方面展开,首先是反射程序集,模块,类的成员以及成员的一些信息;接下来就是动态调用类的成员方法;第三个方面就动态产生程序集,模块和类以及类的成员。好了,现在就让我们从反射各种信息开始吧在C#中,我们要使用反射,首先要搞清楚以下命名空间中几个类的关系:System.Reflection命名空间(1) AppDomain:应用程序域,可以将其理解为一组程序集的逻辑容器(2) Assembly:程序集类(3) Module:模块类(4 阅读全文
posted @ 2013-08-21 22:04 Vic.Zhang 阅读(1055) 评论(0) 推荐(0)
摘要: DataBinding is one of the most powerful features in WPF. But because it resolves the bindings at runtime and does not throw exceptions, it's sometimes hard to find the reason why the data do not appear as expected. There are mainly two reasons:The DataBindingexpression is invalid. Then useTrace 阅读全文
posted @ 2013-08-14 22:21 Vic.Zhang 阅读(205) 评论(0) 推荐(0)