Restrict the use of catalogs
When developing custom catalogs you can add catalog restrictions to e.g. only allow specific Experior license IDs to load the catalog. The use case could be that you will restrict catalog usage to internal use only or similar.
There are 2 ways you can restrict catalog usage;
- using a Build.Config file or
- using a “Keys” attribute in the csproj
Restriction is opt-in, meaning that if you don’t wish to restrict catalog usage, then the default behaviour is that the catalog is complied without license ID / key restriction and everybody with a valid Experior license and physical access to the catalog will be able to load it.
Wildcards are supported for both subsequent solutions, so adding a license ID like ’02*’ will, allow all licenses starting with ’02’.
Using a Build.Config file:
A ‘Build.config’ file can be used in the build process if you want to always restrict catalog usage and apply the restriction for all catalogs being built.
Process:
You create a file named ‘Build.config’. The contents should be valid XML
<br><!--?xml version="1.0" encoding="utf-16"?--><br><key xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><br><items><br><string>0102</string><br><string>0103</string><br><string>02*</string><br></items><br></key><br>
The ‘Build.config’ file can be placed in one of three locations depending on your setup;
- Local to Experior.Build.dll
- Environment variable ‘EXPERIOR_SIGNTOOL_CONF’
- %localappdata%\\Xcelgo\\Experior\\SDK\\Build”
Using a ‘Keys’ attribute
The ‘Keys’ attribute is the more explicit way, since here you are explicitly specifying per project (= catalog) which license IDs (“keys”) are allowed to load the catalog – and you can have it under version control since its part of the source code etc.
Process:
In the csproj for the catalog project, you find the signing Task (normally the <Experior.Build … /> element) and add a ‘Keys=”xxxx|yyyy|zz*”‘ attribute, where xxxx|yyyy|zz* are a ‘|’ separated list of license IDs.
Example:
<br><target name="PluginSigning" aftertargets="AfterBuild"><br><message importance="High" text="Signing plugin $(TargetFileName)..."></message><br><experior.build assemblyfilelocation="$(OutputPath)$(TargetFileName)" debug="true" keys="0102|0103|02*"></experior.build><br></target><br>