View previous topic :: View next topic |
Author |
Message |
FredLarson
Joined: 17 Oct 2005 Posts: 6 Location: Phoenix, AZ
|
Posted: Tue Oct 18, 2005 1:14 am Post subject: Working with an ASP.NET Server Control |
|
|
I am using the demo version of your software with my ASP.NET server control and added a slightly modified version of your sample code to my control constructor. here is the code:
Code: | EncryptedLicenseProvider.SetParameters(licenseParameters);
if (LicenseManager.CurrentContext.UsageMode == LicenseUsageMode.Designtime)
{
bool isLicensed = LicenseManager.IsLicensed(typeof(PCIWebFormMaestro));
if (!LicenseManager.IsLicensed(typeof(PCIWebFormMaestro)))
{
if (LicenseManager.CurrentContext != lastLicenseContext)
{
LicenseInstallForm licenseForm = new LicenseInstallForm();
licenseForm.ShowDialog("Web-Form Maestro", "www.webformmaestro.com", typeof(PCIWebFormMaestro));
}
}
}
else
{
if (LicenseManager.CurrentContext != lastLicenseContext)
{
bool isLicensed = LicenseManager.IsLicensed(typeof(PCIWebFormMaestro));
// Add a message to the rendered page.
}
}
lastLicenseContext = LicenseManager.CurrentContext; |
I dragged an instance of my ASP.NET server control onto a web form container and just as expected, got a dialog box asking for my license code. After entering a license code, I exited Visual Studio and brought it up again to reset the context. I expected to see the same behavior as before when I dragged another instance of my control onto another web form but did not. I then set a breakpoint and found that islicensed was true. I assumed that this was because the License Install Form created a .LIC file after I entered a valid license code, but it did not.
The question is why is islicensed true? I couldn’t find a .LIC file anywhere so where is it finding the license code at designtime? Maybe I missed something in the documentation but I thought that the license key was stored in a .LIC file for design time.
Thanks… _________________ Fred Larson |
|
Back to top |
|
|
Infralution
Joined: 28 Feb 2005 Posts: 5027
|
Posted: Tue Oct 18, 2005 7:25 am Post subject: |
|
|
I suspect that it has created a ".lic" file - perhaps not where you expected. To confirm this use the LicenseManager.IsValid method to retrieve the license and check the LicenseKey is the one you installed eg:
Code: | License license = null;
if (!LicenseManager.IsValid(typeof(MainForm), this, out license))
{
Debug.Writeline((license as EncryptedLicense).LicenseKey));
} |
The ".lic" file should be in the bin directory containing your DLL - but with ASP things can get a little strange. _________________ Infralution Support |
|
Back to top |
|
|
FredLarson
Joined: 17 Oct 2005 Posts: 6 Location: Phoenix, AZ
|
Posted: Tue Oct 18, 2005 5:14 pm Post subject: |
|
|
You are right. It wasn't where I thought it would be. It was in the bin/debug directory of my server control project. I expected it to be in the bin directory of my container project. In other words, I have a test ASP.NET project called "LicenseTestProject." This is the project that uses my server control and the one that was active when I entered the license key. This is where the .LIC file is typically placed in an ASP.NET project.
When I purchase your product, will I also get the source for the LicenseInstallForm? If so, I can take a look at it and if necessary, change it.
Thanks... _________________ Fred Larson |
|
Back to top |
|
|
FredLarson
Joined: 17 Oct 2005 Posts: 6 Location: Phoenix, AZ
|
Posted: Tue Oct 18, 2005 6:07 pm Post subject: |
|
|
I figured out why the .LIC file was in the bin/debug directory of my server control project. Because I frequently debug my control, I had set the reference to my control to the DLL in my server control project, not a DLL that is in the test project BIN directory.
Thanks... _________________ Fred Larson |
|
Back to top |
|
|
Infralution
Joined: 28 Feb 2005 Posts: 5027
|
Posted: Wed Oct 19, 2005 1:05 am Post subject: |
|
|
Glad you found the issue. When you purchase you receive source code for the Licensing DLL classes (including the LicenseInstallForm) _________________ Infralution Support |
|
Back to top |
|
|
|