使用Microsoft Enterprise Library开发前配置

1.新建解决方案。我们打开Visual Studio2010,选择新建项目,在其他项目类型中选择Visual Studio解决方案并对其进行命名(例如:Test),将这个解决方案保存到想要存放的位置,单击确定。

2.添加项目。右击解决方案资源管理器下的解决方案‘Test’,选择添加>新建项目>Visual C#>Web>ASP.NET 空Web应用程序,并对这个Web项目进行命名(例如:Web)。右击解决方案资源管理器下的解决方案‘Test’,选择添加>新建项目>Visual C#>类库,并对这个类库进行命名(例如:Bll)。使用相同的方法添加Dal、Model类库。

3.添加引用。Web、Bll、Dal都需要添加Model引用。其中,Web还需要添加Bll引用,Bll还需要添加Dal引用,Dal需要添加企业库(需单独下载)引用并在页面的引用集中添加using Microsoft.Practices.EnterpriseLibrary.Data;usingSystem.Data.Common;using System.Data;。这样,三层架构就基本配置完成。

4.配置数据库连接。选择Web>Web.config,大家可能不知道或忽略了:这个 <configSections> 还必须是根 <configuration> 元素的第一个子元素。

<
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
Microsoft Press, 2010 少有的介绍 Enterprise Library的书。 Welcome to the era of software reuse! Microsoft Enterprise Library helps accelerate development by providing reusable components and guidance on proven practices. If you build applications that run on the Microsoft .NET Framework, whether they are enterprise-level business applications or even relatively modest Windows® Forms, Windows Presentation Foundation (WPF), Windows Communication Foundation (WCF), or ASP.NET applications, you can benefit from using Enterprise Library. This guide helps you to quickly grasp what Enterprise Library can do for you, presents examples, and makes it easier for you to start experimenting with Enterprise Library. Enterprise Library is made up of a series of application blocks, each aimed at managing specific cross-cutting concerns. The guide will walk you through the most common usage scenarios for each of the functional application blocks, including: * Improving performance by utilizing a local in-memory or isolated storage cache. * Calling into your database stored procedures and managing the results exposed as a sequence of objects for client side querying. * Incorporating cryptography mechanisms to protect your data. * Designing and implementing a consistent strategy for managing exceptions that occur in various architectural layers of your application. * Implementing system logging through the wide variety of out-of-the box logging sinks or your custom provider. * Performing structured and easy-to-maintain validation using attributes and rules sets. The guide also demonstrates various ways of configuring Enterprise Library blocks. Let Enterprise Library do the heavy lifting for you and spend more time focusing on your business logic and less on application plumbing. “You are holding in your hands a book that will make your life as an enterprise developer a whole lot easier.” Scott Guthrie Corporate Vice-President, Microsoft .NET Developer Platform amazon link:http://www.amazon.com/exec/obidos/ASIN/073564523X/buythisbooks-20

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值