private void CommitApplicationTrust(ApplicationIdentity applicationIdentity, string trustXml) {
StoreOperationMetadataProperty[] properties = new StoreOperationMetadataProperty[] {
new StoreOperationMetadataProperty(ClrPropertySet, ApplicationTrustProperty, trustXml)
};
IEnumDefinitionIdentity idenum = applicationIdentity.Identity.EnumAppPath();
IDefinitionIdentity[] asbId = new IDefinitionIdentity[1];
IDefinitionIdentity deplId = null;
if (idenum.Next(1, asbId) == 1)
deplId = asbId[0];
IDefinitionAppId defAppId = IsolationInterop.AppIdAuthority.CreateDefinition();
defAppId.SetAppPath(1, new IDefinitionIdentity[] {deplId});
defAppId.put_Codebase(applicationIdentity.CodeBase);
using (StoreTransaction storeTxn = new StoreTransaction()) {
storeTxn.Add(new StoreOperationSetDeploymentMetadata(defAppId, InstallReference, properties));
RefreshStorePointer();
m_pStore.Transact(storeTxn.Operations);
}
m_appTrusts = null; // reset the app trusts in the collection.
}