About This Release of Enterprise Library
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.|
This release of Enterprise Library includes additions in functionality to several of the existing application blocks. The following sections discuss these and other changes in the current release. In addition, this release has been adapted to work with Microsoft Visual Studio 2008, Windows Management Instrumentation (WMI) version 2.0, and the Microsoft .NET Framework 3.5.
This topic contains the following information about this release of Enterprise Library:
- Contents of This Release
- Integration with the Unity Application Block
- Changes That Affect All Application Blocks
- Changes to the Caching Application Block
- Changes to the Configuration Tool
- Changes to the Cryptography Application Block
- Changes to the Data Access Application Block
- Changes to the Exception Handling Application Block
- Changes to the Logging Application Block
- Changes to the Policy Injection Application Block
- Changes to the Security Application Block
- Changes to the Validation Application Block
- Changes to the Unity Application Block
This release of Enterprise Library contains the following:
- Binaries. The Enterprise Library includes pre-compiled, strong-named assemblies for all the source code. For more information, see Using the Signed Binary Assemblies.
- Source code. The Enterprise Library includes the source code for the application blocks, the configuration tools, the unit tests, and the QuickStarts.
- Unit tests. The Enterprise Library includes the unit tests that were created while the application blocks were being developed. For more information, see Unit Tests.
- QuickStarts. Enterprise Library QuickStarts are brief, easy-to-understand illustrations of key application block features. Each application block includes one or more QuickStart.
- Documentation. Enterprise Library includes documentation that can be viewed with the Visual Studio Help system. The documentation includes guidance about how to use the Enterprise Library and a class library reference.
To download these features, see Enterprise Library 4.1-October 2008 on the Microsoft Download Center.
For a complete list of the application blocks, configuration and other tools, and the core features of Enterprise Library, see Contents of Enterprise Library in the Getting Started section of this guidance.
In this release of Enterprise Library, you can use the Unity Application Block (Unity) to intercept Enterprise Library objects and execute code before or after the body of a function or a method is executed and you can generate instances of Enterprise Library objects and inject them into other objects.
Enterprise Library contains a set of classes that allow you to obtain instances of objects such as a SqlDatabase or a CacheManager, defined in the Enterprise Library configuration, from the Unity container. In addition, new "injection-friendly" façades for some of the Enterprise Library objects replace static façades, which cannot be used with injection. These features use the dependency injection capabilities of Unity and can considerably simplify your code.
Unity provides interceptors that will, when configured in the container, allow you to intercept method calls and attach call handlers to the intercepted methods. For more information on interception see Using Interception with Unity.
For more information about the integration of Unity and Enterprise Library, see Creating Objects Using the Unity Application Block.
The following changes to the Enterprise Library affect all the application blocks:
- Changed: The implementation to defer the evaluation of a resource string used for configuration objects has changed. The resource strings are now evaluated at the moment the string is actually used.
- Fixed: For WMI, InstallServices.bat no longer installs only the main application block assemblies. The install services script now installs the provider assemblies and performs uninstalls in the appropriate order.
- Fixed: Factories that depend on locators now use explicit locks to avoid concurrency issues for the logging and the caching exception handlers. Locking was added back into the locator lookup strategy.
The following is the error message for the error that is fixed:
"The current build operation (build key Build Key[Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.ExceptionPolicyImpl, <policy name>]) failed: The current build operation (build key Build Key[Microsoft.Practices.EnterpriseLibrary.Logging.LogWriter, null]) failed: An item with the same key has already been added."
- Fixed: The Install Instrumentation command on the Programs menu in Windows Vista is fixed. The updated install build script now successfully installs.
- Fixed: The SystemConfigurationSource now gracefully goes to no refreshing when it cannot get the current app domain's configuration file location for the SystemConfigurationSource as is the case with the default LocalIntranet permission set. Fixed: The SqlConfiguration QuickStart now builds properly.
- Fixed: Uninstalling the Windows Installer (.msi file) from non-default location now removes all the files and folders created by the installer.
The following changes have been made to this version of the Configuration tool:
- Fixed: The Edit with configuration tool menu item is fixed; it is now available when you right-click App.config or Web.config after installing Enterprise Library on Windows Server 2008 with Visual Studio 2008 and Windows Server 2003 with Visual Studio Professional Edition.
- Fixed: The integrated configuration tool, which was not adding manageability provider elements to the configuration when a new manageable configuration source was added, is fixed. The design time manageability classes were changed to leverage the IPluginDirectoryProvider service to get the name of the folder containing the binaries to scan for manageability registration attributes, instead of using the AppDomain's base folder. This required moving the ConfigurationManageabilityProviderAttributeRetriever class to a design time project.
- Fixed: The node for Policy Injection Application Block to save the value for "RequirePermission" is fixed. Updated the setting node mappings to use the RequirePermission flag.
- Fixed: The environmental overrides tool no longer fails if the source configuration file is read-only. The save merged configuration command now succeeds even if the source configuration file is read-only.
- Fixed: The stand-alone configuration tool does not fail if Federal Information Processing Standards (FIPS) compliance is enforced. The configuration console now ignores serialization if an error occurs while initializing the isolated storage file.
- Changed: The Type Selector tool has changed. The Type Selector now includes the following new features:
- Ability to filter types. As you type in the Filter text box, the non-matching types are removed from the tree with assemblies.
- Ability to load assemblies from the global assembly cache. Previously, you could only load assemblies from a file.
- Ability to specify closed generic types. Previously, you could only choose the type, but now you can work up a closed generic type by choosing the generic type and its parameters in the new Type Building Tree at the top of the window.
The following changes have been made to this version of the Caching Application Block:
- Fixed: The CacheItem constructor is fixed so that both constructors initialize the expirations.
- Fixed: The code now minimizes the scheduling scavenge requests and increases caching speed if the cache is over the maximum.
- Fixed: The correct exception is now thrown instead of NullReferenceException when the caching section is not present in the configuration file.
The following changes have been made to this version of the Exception Handling Application Block:
- Changed: When building a LoggingExceptionHandler, instead of creating a logging stack every time and ignoring it if the value for the use the default logger flag on the handler is set to true, the build process now uses the value for the flag in the configuration file to create the handler with either Logging.Writer (if true) or the result of creating a new stack (if false). The handler now only knows it has a writer; it does not know where it came from.
- Fixed: The DesignTime nodes for ExceptionHandlers are now handled correctly when using template-based messages. The variables are now accessed correctly when mapping an exception handler configuration object to the corresponding node and a valid configuration is saved.
- Fixed: Invalid XML generated by the XmlExceptionFormatter is fixed. Exception formatters now must include the HandlingInstanceId (which is generated on each exception handling request). The way the exception formatter includes HandlingInstanceId depends on the individual formatter. The XmlExceptionFormatter adds it as an attribute of the top-level Exception element; the TextFormatter adds it as the first line of text. An ID equal to Guid.Empty can be ignored.
The logging exception handler no longer adds the exception handling ID to the message to log. The formatter handles the ID. Exception Formatter types used with the logging exception handler must now implement a constructor with the parameters TextWriter, Exception, and Guid.
There is no backward compatibility support. Creators of custom formatters must update the formatters to be used with this version so that the handling instance ID is not lost because a formatter does not support it.
The following changes have been made to this version of the Logging Application Block:
- Fixed: The WMI provider for several trace listeners now supports saving changes. WMI settings are added to support saving changes for FormattedEventLogTraceListener and FormattedDatabaseTraceListener.
- Fixed: WMI support for trace listeners can now save the new Filter property to configuration objects. Logging Application Block files are updated so they can save a Filter value when pushed from WMI. WMI settings are added to support saving changes for FormattedEventLogTraceListener and FormattedDatabaseTraceListener.
- Fixed: The Database trace listener no longer fails if no formatter is specified. The assembler for the FormattedDatabaseTraceListener now uses the inherited GetFormatter method, which determines whether a new formatter should be created.
- Fixed: Running the logging Unity integration now works on release mode.
- Added: Configuration support to opt-out of the impersonation-reverting default setting has been added. This fixes the rolling flat file trace listener problem when used in a Web application and when impersonation is enabled. To opt-out of the impersonation-reverting default mode, set the new <section> revertImpersonation attribute to false. The default setting is true. This supports configuration support, design time support, and manageability support (both WMI and group policy).
- Fixed: Log entries with a user supplied categories collection that result in a non-serializable object is fixed. The potentially non-serializable categories collection is now copied to an array before serializing.
- Fixed: The XmlLogFormatter now properly generates an XML representation of an object when that representation may contain characters that should be escaped. The XmlLogFormatter now uses an XmlWriter instead of a StringBuilder.
- Fixed:FormattedTraceListenerWrapperBase now checks its filter before it forwards requests to the wrapped trace listener.
- Fixed: The rolling file trace listener no longer fails when rolling for size only and the date template is empty. The log file is not truncated when the size threshold is reached. A timestamp pattern is not necessary or desired when using an increment because the increment is appended to the base file name.
- Fixed: The constructor overloads for FormattedTextWriterTraceListener now use the formatter properly.
- Fixed: A file name error is fixed so that the file name is now correct, fileNameWithoutExtension + .20080815.1" + extension, when the datetimepattern is set to yyyymmdd or yyyyddmm format in the rollingflatfiletracelistener.
The following changes have been made to this version of the Policy Injection Application Block:
- Fixed: Design time for the policy injector collection now reads the default injector from the configuration file. The node creation classes are updated to set the default injector node property on the injectors collection node.
- Changed: The matching classes implementation has changed. The implementation was moved to Unity. The classes still exist in the Policy Injection Application Block as configuration placeholders to provide backward compatibility.
- Changed: The Policy Injection Application Block can now use a container. The container is configured with the Policy Injection Application Block configuration.
- Changed: The Policy Injection Application Block now has only the default interceptor. Non-default interceptor options have been removed. The <injectors> element has been removed. The default interception mechanism of the Policy Injection Application Block enables you to reuse existing object instances.
- Changed Remoting Interception has been renamed Transparent Proxy Interception.
The following change has been made to this version of the Security Application Block:
- Fixed: The documentation for the section, "Customizing the Medium Trust Policy," is fixed. The documentation now specifies in the Policy Injection Application Block that Security.Infrastructure permission is required in order to use a remoting injector.
The following change has been made to this version of the Validation Application Block:
- Fixed: The Validation Block now observes IgnoreNulls and ValidationComposition for parameter validation.
- Added: The implementation of IOperationBehavior was added to the ValidationBehavior and ValidationBehaviorAttribute class. This enables you to add different rulesets to different operations in a contract.
The following changes have been made to this version of the Unity Application Block:
- Fixed: Issues with building generic decorator chains are fixed.
- Fixed: The case that a null reference exception was thrown when looking at the message property of a cross-domain BuildFailedException is fixed. BuildFailedException and ResolutionFailedException now correctly serialize cross-domain. The BuildFailedException now retrieves the serialized fields in its serialization constructor.
- Added: Support was added for generic parameter injection configuration with the GenericParameter support in the InjectedMembers API. A new configuration element enables you to do the same configuration through a configuration file. Parameters and properties can now take a genericParameterName attribute. When genericParameterName is specified, only an optional dependency injection value can be set, and it cannot specify a type. Setting the genericParameterName causes a GenericParameter to be created; it uses the value set for genericParameterName and, optionally, the dependency element's name as the resolutionKey if such a dependency element exists and has a name.
- Added: A PerThreadLifetimeManager was added. The container returns the same instance on the same thread and a different instance on different threads.
- Fixed: Injection configuration for properties and methods is fixed. Now both default to DependencyElement.
- Changed: Registered names are now available as an ObjectBuilder policy so that you can actually do a ResolveAll from within the strategy chain. The container automatically registers itself with itself.
- Added: The implementation for the ResolvedArrayParameter support was added; it relies on the ResolveAll method in IUnityContainer. Both the core mechanism and the API support are implemented. Configuration support for ResolvedArray is provided with the <array> configuration element.
- Added: The new parameters, genericResolvedArray and a ParameterValue, GenericParameter, were added to the Unity configuration API for generic array support. Support for closed generics (public class MyClass<string>) has previously existed. Support for open generics (public class MyClass<T>) is new.
- Changed: Standard typeConfig configuration no longer requires an explicit extension type in the .config file. The default extension type is used when one is not specified. The extension type is now optional.
- Changed: The overloads for RegisterType now get InjectionMembers in order to configure injection without the need to call ConfigureInjectionFor.
- Added:InterceptionExtension.PolicyDefinition APIs were added to provide a simplified way to wire together RuleDrivenPolicies to support interception. The general purpose API requires repeated calls to the InjectedMembers.ConfigureInjectionFor and RegisterType methods. The streamlined extension API reduces the overhead required to manage the various strings and cross links, thus making the process more obvious and convenient.
- Added: Unity interception support was added, including configuration support. You can now define interceptors and when they should be used. Interceptors are defined like lifetime managers: you can just specify a type and you will get an instance of that type. You can also specify a value and, optionally, a type converter to provide more information about how the interceptor should be built.
- Fixed: Type converters specified through configuration are now properly handled and do not cause issues in multi-threaded applications.