
Enterprise Library Namespaces
All application blocks adhere to the same convention for namespaces. All code for the Enterprise Library is contained under the root namespace, Microsoft.Practices.EnterpriseLibrary.
Each application block is contained in its own namespace under this root. For example, the Security Application Block uses the Microsoft.Practices.EnterpriseLibrary.Security namespace.
Complex application blocks may include sub-namespaces, but only if this is necessary to improve readability. For example, the SQL Server portion of the Data Access Application Block uses the Microsoft.Practices.EnterpriseLibrary.Data.Sql namespace.
To use elements from the application block without fully qualifying the element reference, add using statements (C#) or Imports statements (Visual Basic .NET) to the top of your source code file. For example, to use elements from the Caching Application Block without fully qualifying the element reference, add the following using statements (C#) or Imports statements (Visual Basic) to the top of your source code file.
using Microsoft.Practices.EnterpriseLibrary.Caching;
using Microsoft.Practices.EnterpriseLibrary.Caching.Expirations;
Imports Microsoft.Practices.EnterpriseLibrary.Caching
Imports Microsoft.Practices.EnterpriseLibrary.Caching.Expirations
Note: |
| For Visual Basic projects, you can also use the References page of the Project Designer to manage references and imported namespaces. To access the References page, select a project node in Solution Explorer. On the Project menu, click Properties. When the Project Designer appears, click the References tab. |