Caching QuickStart

Retired Content

This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This page may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.

The latest Enterprise Library information can be found at the Enterprise Library site.

The QuickStart application demonstrates some of the key features of the Caching Application Block. It uses a set of walkthroughs to demonstrate these features. The walkthroughs are implementations of the situations discussed in "Key Scenarios" and show the following:

The QuickStart uses a top-level handler to catch any exceptions that occur during any of the scenarios. The handler displays a dialog box with the exception message.

System Requirements

To build and run this QuickStart, you need the following:

  • Microsoft Windows 2000, Windows XP Professional, or Windows Server 2003 operating system
  • Microsoft .NET Framework, version 2.0
  • Microsoft Visual Studio 2005 development system

The QuickStart does not require you to perform any setup procedures prior to building and running the application.

Note

The default configuration of the QuickStart does not use a persistent backing store.

Building and Running the QuickStart

The QuickStart ships as source code, which means you must compile it before running it. You build the QuickStart using Visual Studio.

To build the Caching QuickStart

  1. Ensure the Enterprise Library Source Code has been installed
  2. Open the Enterprise Library Source Code folder from Windows Explorer, or from the Start Menu shortcut: on the taskbar, click Start, point to All Programs, point to Microsoft patterns and practices, point to Enterprise Library 3.1 – May 2007 and select Enterprise Library 3.1 Source Folder.
  3. Open the QuickStarts folder, then Cache, then CS (for C#) or VB (for Visual Basic .NET).
  4. Double-click the CachingQuickStart.sln icon.
  5. Visual Studio opens, displaying the solution file. On the menu, click Build.
  6. Click Rebuild Solution. By default, this is a debug build.
  7. Press F5 to run the QuickStart.

QuickStart Configuration

The QuickStart configuration information is located in the same directory as the QuickStart project. It has the following attributes:

  • The cache manager for the caching operations section is named "Default Cache Manager." The cache manager for the section on loading the cache proactively and reactively is named "Loading Scenario Cache Manager."
  • Data is written only to the in-memory cache (not to a backing store).
  • Expiration cycles occur every 60 seconds.
  • Scavenging occurs when there are 1000 items in the cache.
  • Scavenging removes 10 items from the cache.

The walkthroughs in this QuickStart are shipped with a defined configuration, which is included in the App.config file. This file is located in the same folder as the QuickStart project file.

To change or view these settings, use the Enterprise Library Configuration Console to open the App.config file in the directory containing the QuickStart project file. The App.config file contains the configuration data.

Each time you build the code, Visual Studio copies the App.config file to the output directory for the project (the same directory where the QuickStart executable is created), and renames it to CachingQuickStart.exe.config.

This means that if you want to use the Configuration Console to change any of the configuration settings, such as the expiration cycle, and you are also planning to rebuild the solution, you must change the settings by opening the App.config file located in the QuickStart source directory. You can change the application configuration by using the Configuration Console to open the CachingQuickStart.exe.config file. However, these changes will be overwritten in the next successful build.

This means that when you are using the Configuration Console to open the App.config file and change configuration settings, you must copy the files to the output directory. You can do this either by hand or by rebuilding the project. Remember that you do not have to rebuild your code simply to change the configuration settings. The commands executed upon successful build are there for convenience.

Retired Content

This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This page may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.

The latest Enterprise Library information can be found at the Enterprise Library site.