使用.Net 3.5,我可以使用MSBuild创建SSO应用程序(类型:配置存储)并使用 SSOSettingsFileReader.ReadString(appName,keyName)读取值。 msbuild脚本是:
<Sso.CreateApp ApplicationName="$(SsoAppName)" SettingsFile="@(SettingsGroup)"
AdminGroup="$(SsoAppAdminGroup)" UserGroup="$(SsoAppUserGroup)" ContactInfo="$(MsiManufacturer)"
SettingNameWhiteList="$(SsoSettingNameWhiteList)" SettingNameBlackList="$(SsoSettingNameBlackList)"
Condition="%(Identity) == %(Identity) and Exists(%(fullpath))"/>
升级到.Net 4.6.2之后,我使用的是相同的,应用程序是使用所有键/值创建的,但我不能再通过 SSOSettingsFileReader 或<读取按键值EM> SSOConfigStore.GetConfigStore (...)。
var ssoStore = new SSOConfigStore();
var appMgmtBag = new ConfigurationPropertyBag();
((ISSOConfigStore) ssoStore).GetConfigInfo(appName, idenifierGUID, SSOFlag.SSO_FLAG_RUNTIME, appMgmtBag);
object propertyValue;
appMgmtBag.Read(propName, out propertyValue, 0);
return (string)propertyValue;
错误消息是:
The mapping does not exist. For Config Store applications, the config info has not been set.
如果我使用SSO应用程序配置,请手动创建具有测试键/值的应用程序。我可以检索该值。
请告诉我如何使用MSBuild自动创建SSO应用程序。