Microsoft.Interop.Security.AzRoles.AzAuthorizationStoreClass.Initialize fails with System.IO.FileLoadException

3

Our ASP.NET web application uses Authorization manager. On a page of this web application, the authorization store which is a local XML file on the server is accessed many times to perform access check. Some clients of ours are getting a System.IO.FileLoadException when they access this page. This is intermittent.

Stack trace:

System.Web.HttpUnhandledException: Exception of type 'System.Web.HttpUnhandledException' was thrown. ---> System.IO.FileLoadException: The process cannot access the file because it is being used by another process. (Exception from HRESULT: 0x80070020) at Microsoft.Interop.Security.AzRoles.AzAuthorizationStoreClass.Initialize(Int32 lFlags, String bstrPolicyURL, Object varReserved)

The process monitor shows a SHARING VIOLATION. I have searched for a solution, but could not find one. The client is on Windows Server 2003 SP2. So this hotfix http://support.microsoft.com/kb/919754 does not seem to apply because it is part of Windows Server 2003 SP2.

The code to access the authorization store is like this:

private IAzApplication2 AzmanApplication
{
    get
    {
        AzAuthorizationStoreClass store = new AzAuthorizationStoreClass();
        store.Initialize(0, _connectionString, null);
        return store.OpenApplication2(_applicationName, null);
    }
}

Anyone have any ideas how I could resolve this?

azman
fileloadexception
asked on Stack Overflow Dec 11, 2012 by user630585 • edited Dec 19, 2017 by Machavity

1 Answer

0

this means that file (probably the XML file you have for AzMan) is open in another application. make sure azman.mmc is not running having this store open for edit/review etc.

answered on Stack Overflow Jul 24, 2013 by tecfield

User contributions licensed under CC BY-SA 3.0