I'm working on a licensing prototype where a piece of information needs to be embedded into the dll during the build time. Below is the approach I have taken to solve this problem
I have two projects, one is a custom project (Project A), where the license information will be embedded and the other one (Project B), responsible for embedding the license information into Project A
Project A has a .licx file embedded into it and this file points to Project B. So, when Project A is built, Project B will be triggered by License Compiler and the license information will be embedded using the SetSavedLicenseKey() method (given below). The below GetLicense() method is called when Project B is triggered by the License Compiler.
public override License GetLicense(LicenseContext context, Type type, object instance, bool allowExceptions)
{
string text = "Sample Text";
context.SetSavedLicenseKey(type, Encrypt(text));
return new License();
}
Here, I have an additional requirement where I need some information of project A into the GetLicense() method. I tried using the GetCallingAssembly() and other related methods, but they were able to back-track until License Compiler. I would need the information on who is calling the License Compiler. Is it possible to obtain the information regarding the caller of the License Compiler?