// use this to update a running app // after you change the AzMan policy public void UpdateCache() { try { store.UpdateCache(null); Marshal.ReleaseComObject(app); app = store.OpenApplication(appName, null); } catch (COMException x) { throw new AzManException("UpdateCache failed", x); } }
public AzManHelper(string connectionString, string appName) { this.appName = appName; try { // load and initialize the AzMan runtime store = new AzAuthorizationStore(); store.Initialize(0, connectionString, null); // drill down to our application app = store.OpenApplication(appName, null); } catch (COMException x) { throw new AzManException("Failed to initizlize AzManHelper", x); } catch (System.IO.FileNotFoundException x) { throw new AzManException(string.Format("Failed to load AzMan policy from {0} - make sure your connection string is correct.", connectionString), x); } }