At runtime, your licensed project will include the DeployLX.Licensing.v5.cs file directly in your project and there won't be any references to the DeployLX.Licensing.v5.dll. When you create a custom limit, this does not change. The problem you'll face however, is editing a license in DeployLX that uses your custom limit. Since your custom limit does not derive from the type defined in the DeployLX.Licensing.v5.dll runtime the DeployLX Manager will not be able to load it.
To fix this you'll create a special helper project that acts as a shim to the DeployLX Manager. After following all the instructions in the README.TXT included with the embeddable source code you will need to perform the following additional steps.
Creating the Helper Shim
- Open your existing solution in Visual Studio.
- Create a new class library project named CustomEditor.
- Add a reference to the binary runtime DeployLX.Licening.v5.dll.
- With the shim project selected, select Project | Add Existing Item.
- Navigate to your existing project with the custom limit and select your CustomLimit.cs file.
- Don't select Add. Instead select the drop down arrow just beside it and select Add As Link.
You've now created the shim class that you will register in the DeployLX Manager application.
Registering the Helper Shim
- Open the DeployLX Manager.
- Select the Application Menu followed by DeployLX Options.
- Select Licensing | Custom Limits.
- Select Add.
- Browse for the CustomLimit.dll in the project output folder and select Open.
- Select OK, OK to close the options dialog.
Now you can add references to your custom limit to licenses in the Advanced License Editor. However, DeployLX will add a reference to the shim assembly instead of the assembly you distribute with your project. You'll make one final change to the CustomLimit.cs class.
Updating the Custom Limit
Override the QualifiedTypeName property of your custom limit with the following code. This enables DeployLX to serialize just the information needed to connect the license to your custom limit at runtime.
Public Overrides ReadOnly Property QualifiedTypeName() As String Get Return GetType(MyCustomLimit).FullName End Get End Property
public override string QualifiedTypeName { get { return typeof( MyCustomLimit ).FullName; } }