Azman gives same error using either local xml or SQL Server for storage

0

Recently two users in our system started getting this error when trying to add them to a role.

System.Runtime.InteropServices.COMException: Cannot create a file when that file already exists. (Exception from HRESULT: 0x800700B7)

What is interesting is that the same error occurs regardless of the configuration, running locally we use an XML store and in the test environment it uses SQL Server.

Here is code where is blows up - AddMemberName() - as you can see this is pretty straightforward stuff and it's worked well for a while, it's just these two users all of the sudden

public void AddUserToRole(string roleName, string userName, bool upn)
{
   string uName = userName;

   if (upn)
      uName = getAltUserNames(userName).First();

   AzAuthorizationStore store = new AzAuthorizationStoreClass();
   store.Initialize(2, _provider.StoreLocation, null);
   IAzApplication app = store.OpenApplication(_provider.ApplicationName, null);
   IAzRole role = app.OpenRole(roleName, null);
   role.AddMemberName(uName, null);
   role.Submit(0, null);
   Marshal.FinalReleaseComObject(role);
}

I tried googling various different terms but can't find much of anything regarding this. I did read this post but it doesn't seem to be the issue.

Thanks

c#
azman
asked on Stack Overflow Feb 19, 2013 by Kenn • edited Feb 19, 2013 by marc_s

1 Answer

1

Check you Active Directory usernames and the underlying OU name especially. Check for duplicates and mismatches. I had an issue once where a user got married and her name changed.

answered on Stack Overflow Feb 19, 2013 by Bikey

User contributions licensed under CC BY-SA 3.0