ConfigurationErrorException-Security App Block

Topics: Security Application Block
Aug 20, 2008 at 8:59 AM
Edited Aug 20, 2008 at 9:03 AM
    Im, using EntLib 3.1 and VSTS 2005(sp1).
    I'm having problem with the Security Application Block.
    I've followed the guidance in the documentation on how to use this application block.
    In the "Determining Whether a User is Authorized to Perform a Task" parts I received the error when I logged in to the page that contains this code :

protected void m_AuthorizeUser_Click(object sender, EventArgs e){
IPrincipal principal = new GenericPrincipal(User.Identity, new string[] { "Manager" });
IAuthorizationProvider provider = AuthorizationFactory.GetAuthorizationProvider("Task");
if (provider.Authorize(principal, "DemoRule"))
        m_AuthorizeUserLabel.Text =
        m_AuthorizeUserLabel.Text =
"Not authoriza";

This is the error I received in the debug mode:
An error occurred creating the configuration section handler for securityConfiguration: Could not load file or assembly 'Microsoft.Practices.EnterpriseLibrary.Security, Version=, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040) (C:\Documents and Settings\My Documents\Visual Studio 2005\WebSites\WebSite5\web.config line 12)

I've already included all the needed using statements and library.
Thank You, Any help is very apperciated.
Aug 20, 2008 at 1:31 PM


This should help