Windows Server AppFabric 使用

Windows Server AppFabric 是一组集成技术,可更轻松地生成、扩展和管理 IIS 上运行的 Web 应用程序和复合应用程序。Windows Server AppFabric 适用于使用 ASP.NET、Windows Communication Foundation (WCF) 和 Windows Workflow Foundation (WF) 生成的应用程序。

为您轻松生成和管理复合应用程序提供了全新功能,包括: Visual Studio 中增强的设计和开发工具,可生成功能强大的复合应用程序通过与 IIS Manager 和 Windows PowerShell 的集成来管理和监控服务和工作流分布式内存中应用程序缓存,可改善应用程序性能

使用 Windows Server AppFabric,开发人员可以生成其下一代复合应用程序,管理员可以托管和管理这些应用程序。同时集成了以代码名称“Dublin”和代码名称“Velocity”预发布的技术。

1. Install AppFabric from

http://www.microsoft.com/downloads/zh-cn/details.aspx?displaylang=zh-cn&FamilyID=467e5aa5-c25b-4c80-a6d2-9f8fb0f337d2


 

2. Set up monitoring

 
3.config monitoring db

 
4.


5.

6. set up Caching Service



7.


8. 配置完之后, 还需要使用PowerSehll AppFabric Cache 管理工具

Use-CacheCluster

Grant-CacheAllowedClientAccount domain\username

New-Cache "cachename"

Start-CacheCluster

9. 代码:

            DataCacheServerEndpoint[] servers = new DataCacheServerEndpoint[1];
            servers[0] = new DataCacheServerEndpoint("HostName", 22233);

            // Setup the DataCacheFactory configuration.
            DataCacheFactoryConfiguration factoryConfig = new DataCacheFactoryConfiguration();
            factoryConfig.Servers = servers;

            // Create a configured DataCacheFactory object.
            DataCacheFactory mycacheFactory = new DataCacheFactory(factoryConfig);

            // Get a cache client for the cache "NamedCache1".
            DataCache myDefaultCache = mycacheFactory.GetCache("CacheName");
            myDefaultCache.Add("tt", "vvvv");
            v = myDefaultCache.Get("tt");

原文地址:https://www.cnblogs.com/frankzye/p/2014914.html