Microsoft Enterprise Library 6 – Final Release
Welcome to the final release of Microsoft Enterprise Library 6
This document contains a brief summary of Microsoft Enterprise Library 6, including late-breaking information that is not included in the main documentation. Additional information and bug fixes delivered after release are available on the Enterprise Library Community site
and on the Enterprise Library MSDN site
Where to get it?
Via NuGet – use the NuGet Package Manager in Visual Studio and search online for the “enterpriselibrary” packages. Pick the official Microsoft packages.
What’s New in this Release?
This major release of Enterprise Library contains many compelling new features and updates that will make developers more productive. These include:
- Major changes throughout Enterprise Library to make it simpler and easier to learn and use whilst minimizing the impact of these changes for existing users.
- A new Semantic Logging Application Block to make it easier to adopt semantic/structured logging in your applications.
- The addition of the Transient Fault Handling Block as a full member of the library to help you make your on-premises and Windows Azure based applications more resilient to transient errors.
- Several enhancements to Unity type registration to help you streamline the registration of types in the Unity container.
- Support for Windows Store apps.
- Simpler programmatic configuration for all the blocks.
- Deeper integration with other technologies such as ASP.NET MVC and WebApi.
The detailed change log is included in the Enterprise Library documentation and also at the end of this document.
Installing with Previous Versions of Enterprise Library
You cannot install Enterprise Library 6 side-by-side with a previous version of the library in the same Visual Studio project.
- Supported architectures: x86 and x64.
- Operating systems: Microsoft Windows® 8, Microsoft Windows® 7, Windows Server 2008 R2, Windows Server 2012.
- Supported .NET Frameworks: Microsoft .NET Framework 4.5, .NET for Windows Store Apps (previously known as WinRT) for Unity and the Transient Fault Handling Application Block.
- Rich development environment: Microsoft Visual Studio 2012, Professional, Ultimate, or Express editions. The database setup scripts depend on the SQL Server Data Tools that are included in a standard installation of Visual Studio.
For the Data Access Application Block, the following is also required:
- A database server running a database that is supported by a .NET Framework 4.5 data provider.
For the Logging Application Block, the following may be required:
- If you are using the Message Queuing (MSMQ) Trace Listener to store log messages, you need the Microsoft Message Queuing (MSMQ) components installed.
- If you are using the Database Trace Listener to store log messages, you need access to a database server.
- If you are using the E-mail Trace Listener to store log messages, you need access to an SMTP server.
For the Semantic Logging Application Block, the following may be required:
- If you are using the SQL Database Sink to store log messages, you need access to a SQL Server database server. The following are supported: SQL Server 2008 and higher, SQL Server LocalDB, Windows Azure SQL Database.
- If you are using the Windows Azure Sink to store log messages, you need access to a Windows Azure storage account.
For the Transient Fault Handling Application Block, the following is required to install the NuGet package:
- NuGet 2.2. This is included in Visual Studio 2012 Update 2. Once the package is downloaded, you can copy the assemblies to a machine that does not have NuGet 2.2 and use the block there.
If these dependencies are not met, you may not be able to use certain Enterprise Library features.
The following learning resources are recommended:
Microsoft would appreciate feedback on any issues found, or any other general comments on this release.
To report a bug, use online Issue Tracker
. Other feedback or questions can be posted on the Enterprise Library Codeplex forum
We look forward to your comments!
Community support is provided via Enterprise Library Codeplex forum
New-EventLog -LogName Application -Source 'Enterprise Library Logging'
- If you are using the Transient Fault Handling Application Block, you should ensure that you are using version 4.0.30319.18003 or later of mscorlib.dll, otherwise you may see a VerificationException exception at run time. For more information, see http://support.microsoft.com/kb/2748646.
- If you are using the Transient Fault Handling Application Block, you must have NuGet 2.2 in order to install the NuGet package. Note that this update is included in Visual Studio 2012, Update 2.
- To run the coded UI tests in the Reference Implementation solutions, you must have the Visual Studio 2012 Ultimate edition.
- The Semantic Logging Application Block uses the TraceEvent library (http://bcl.codeplex.com/wikipage?title=TraceEvent) internally. The Globalization Warnings reported by FxCop static analysis in this library have not been addressed.
- The Semantic Logging Application Block running out-of-process only supports logging events authored using the managed EventSource class.
- Using the Semantic Logging Application Block, you should not new up a listener, write a log message, and the dispose the listener. The typical usage pattern is to initialize listeners during application start up, log messages while the application is running, and then dispose the listeners during application shutdown.
- When you author a custom EventSource to use with the Semantic Logging Application Block, you should only use enum types of int32 or int64. For more information, see http://connect.microsoft.com/VisualStudio/feedback/details/785409/eventsource-manifest-generation-creates-wrong-map-values-for-enum-types-other-than-int32-or-int64.
- The scripts included with the Semantic Logging Application Block to create a database for the SqlDatabaseSink only support SQL Server 2008 or higher, SQL Server LocalDB, Windows Azure SQL Database.
- Localized event source using EventSourceAttribute.LocalizationResources when using Semantic Logging Application Block in process is not currently supported.
- The Logging Application Block declarative configuration does not support runtime configuration changes.
- If you are writing to the Windows Event Log using the Logging Application Block from an application that does not run with admin rights, you must ensure that you add the event source first by using the following PowerShell command:
- Documentation has not been tested for this release and the final documentation will be available later.
- QuickStarts and sample code included have not been extensively tested. For example, they have not been tested for performance, security, globalization, and accessibility.
- The EnterpriseLibraryContainer class no longer exists. You must now explicitly bootstrap the blocks in your code now that Enterprise Library no longer relies on Unity to perform this function.
- Support for configuration using Group Policy has been removed from this release.
- Instrumentation has been removed from the blocks in this release.
- Enterprise Library no longer uses the Unity Dependency Injection (DI) container to build Enterprise Library objects for your application. In this release, each block includes factories to build the Enterprise Library objects and/or static facades to access the Enterprise Library functionality. This change only affects the way that you instantiate the Enterprise Library objects you use in your application, it does not affect the functionality of those objects.
- The WMI trace listener has been removed from the Logging Application Block.
- All the blocks have been updated to the .NET 4.5 Framework.
- All of the blocks have new bootstrapping methods that do not rely on Unity.
- The dependency on Unity has been removed from all blocks including Common. The only exception is the Policy Injection Application Block which takes a dependency on Unity.Interception.
The following blocks have been deprecated and removed from the Enterprise Library.
- Caching Application Block
- Cryptography Application Block
- Security Application Block
Enterprise Library includes the following new blocks.
- Semantic Logging Application Block
- Transient Fault Handling Application Block (this block was previously a part of the Enterprise Library Integration Pack for Windows Azure)
Data Access Application Block
The provided SQL Server scripts now support SQL Server 2005 or later. In previous versions of Enterprise Library, the scripts supported SQL Server 2000 or later.
The tests for the Data Access Application Block now use Microsoft SQL Server 2012 Express LocalDB.
Data Access Application Block objects can be created directly from configuration without using a DI container.
data provider is deprecated in version 4.5 of the .NET Framework; features in the current version of Enterprise Library that rely on this data provider are also deprecated. These features may be removed in a subsequent release of Enterprise Library.
Exception Handling Application Block
Exception Handling Application Block objects can be created directly from configuration without using a DI container.
Logging Application Block
The behavior of the RollingFlatFileTraceListener
class has changed when the file is set to roll at midnight.
Take the following scenario:
- On Monday, trace message #1 is written by the RollingFlatFileTraceListener trace listener.
- On Tuesday, no trace messages are written to the log.
- On Wednesday, no trace messages are written to the log.
- On Thursday, trace message #2 is written by the RollingFlatFileTraceListener trace listener.
Previously trace message #1 would have appeared in a log file dated Wednesday, because the RollingFlatFileTraceListener
trace listener rolled the log when it wrote a message.
Now, trace message #1 appears in a log file dated Monday, because the RollingFlatFileTraceListener
trace listener rolls the log every day at midnight.
The Logging Application Block now includes a JSON formatter.
The WmiTraceListener Class
class has been removed from this block.
Email Event Listener
Fixed several bugs that resulted in null reference exceptions being thrown when providing invalid configuration data for the email event listener.
MSMQ Event Listener
More error checking for configuration settings was added to this listener.
A new constructor was added to facilitate creating MSMQ event listener objects.
Rolling Flat File Event Listener
A new constructor was added to facilitate creating rolling flat file event listener objects.
You can now use the existing listeners to write log messages asynchronously.
Semantic Logging Application Block
The internal implementation has changed since the CTP release. The event listener implementations have been replaced by a set of Sink classes and an ObservableEventListener
class. This has decoupled the event destinations from the event listener and enabled additional extensibility scenarios.
The database schema has changed since the CTP release. You will need to recreate any logging databases using the DatabaseSink.sql script.
The GenericDatabaseSink has been removed from the block since the CTP release.
Transient Fault Handling Application Block
The following changes have been made to the Transient Fault Handling Application Block since it was released as part of the Enterprise Library Integration Pack for Windows Azure.
- Added support for Windows Azure Caching
- Added support for Windows Azure Storage 2.0. However, if you are using version 2 of the Windows Azure Storage Client Library, it is recommended that you use the built-in retry policies in the Windows Azure Storage Client Library in preference to the retry policies for the Windows Azure Storage Service in the Transient Fault Handling Application Block.
- Updated to support Windows Azure Service Bus 1.8
- Error code 40540 from SQL Database added as a transient error (see http://msdn.microsoft.com/en-us/library/ff394106.aspx#bkmk_throt_errors).
- Added error codes 10928 and 10929 from SQL Database as transient errors (see http://blogs.msdn.com/b/psssql/archive/2012/10/31/worker-thread-governance-coming-to-azure-sql-database.aspx).
- Windows Azure storage account not found is no longer treated as a transient fault.
- Fixed bug whereby an attempt to load an assembly resulted in a retry on failure.
- The obsolete asynchronous overloads of the RetryPolicy.ExecuteAction method have been removed. You should use the RetryPolicy.ExecuteAsync method instead.
The classes located in the namespaces in the following list can now be found in Microsoft.Practices.EnterpriseLibrary.TransientFaultHandling
The PowerShell script Update-EntlibConfiguration.ps1
updates the configuration files in an existing project to reflect the changes in namespaces. Visual Studio tools help you fix your code when it detects the changed namespaces.
Policy Injection Application Block
The call handlers have been moved from the individual blocks in the Policy Injection Application Block.
Validation Application Block
class no longer automatically builds its configuration from the configuration file. You must now invoke the SetDefaultConfigurationValidatorFactory
method to load the configuration from the configuration file. This is a breaking change.
- The Unity assembly is now Security Transparent.
- Unity now supports NetCore (Windows Store apps).
- The bug that caused a first chance exception when registering a singleton is fixed.
- The bug that resulted in static properties not being filtered out when doing property injection is fixed.
- Internally, the WinRT namespaces that support Unity in Windows Store apps have been renamed to NetCore.
- Unity now supports resolving objects of type Lazy<T>
- Unity now supports registration by convention through the new RegisterTypes method.
- Unity now includes support for ASP.NET MVC and ASP.NET Web API.