03 2011 档案
EntityFramework4.0中遇到New transaction is not allowed because there are other threads running in the session
摘要:在使用Entity Framework 4.0时,我们遇到这样的Exception: New transaction is not allowed because there are other threads running in the session,是在这样的场景下面: 1: [Test] 2: [ExpectedException(typeof(System.Data.EntityEx... 阅读全文
posted @ 2011-03-22 15:08 PetterLiu 阅读(3216) 评论(1) 推荐(1)
在VS2010中配制Elmah邮件发送到Gmail
摘要:Elmah是一个开源的组件,用来记录web应用程序的error。如果你还不了解它,请先去官方网站。 它通用对Http Modules和 Http Handlers编程实现的。这里我们配制它自动发mail到你的Gmail邮箱。 首先,我们在VS2010中安装NuGet,如下图: 然后在项目Reference上点击右键,有如下Menu: 查找Elmah项目,然后Install 你还可以使用Power... 阅读全文
posted @ 2011-03-09 16:24 PetterLiu 阅读(1631) 评论(0) 推荐(0)
几条软件开发心得
摘要:几条软件开发心得: 1.始终使用源代码管理系统做版本控制,即使只有一个开发人员。这么做你不能马上丢失整套源代码,既能够分享代码给其他人,也能有控制代码历史记录的优点。 2.使用自动化工具来遵循编码标准。 3.如果你用一种方式编码风格,保持相同的风格(定义变量,方法名等)。 4.代码量大并不意味是好的代码。保持它们简单,减少复杂性。 5.不要使用数字的字符串,而是使用常量。这样使得代码模块性,可读性... 阅读全文
posted @ 2011-03-08 16:02 PetterLiu 阅读(595) 评论(4) 推荐(3)
ASP.NET Web应用程序中用Windows Server AppFabric Cache配制Session State
摘要:阅读这篇POST时,您需要了解Asp.net web应用程序,Windows Server AppFabric Cache. 如您不熟悉可以先阅读Windows Server AppFabric Cache 介绍一。 打开Cache PowerShell 控制台(Start –> Windows Server AppFabric –> Caching Administration Windows... 阅读全文
posted @ 2011-03-02 10:09 PetterLiu 阅读(675) 评论(0) 推荐(0)
Windows Server AppFabric Cache 介绍一
摘要:我们知道现在基于net 4.0的缓存可以使用Windows Server AppFabric,今天来介绍一下。首先我的环境是Win7 Enterprise,安装II7相关组件。下载安装包,或通过 Web Platform Installer 进行安装也可以了。 接下来是配置Windows Server AppFabric Cache,有一个向导也很简单,此处我们选择默认的SQL Server A... 阅读全文
posted @ 2011-03-01 18:31 PetterLiu 阅读(2190) 评论(2) 推荐(0)