Failing to deactivate can be caused by many things -- are you actually activated? I know "formOpenDentalA.isActivated == true", but is that value up-to-date? Also, did you change your date-time settings? That can cause problems too.
Today I changed the settings for the trial on one of my products to '0' for some testing and then back to 30 days.
I have a menuItem 'Licensing' that has the following code. This has always worked in the past, but now when I click it TurboActivate throws the exception below. Could this be a problem with the activation server, as my code has not changed?
public void menuItemLicensing_Click(object sender, EventArgs e) { System.Windows.Forms.Cursor.Current = System.Windows.Forms.Cursors.Default; if (formOpenDentalA.isActivated == true) { // deactivate product without deleting the product key // allows the user to easily reactivate TurboActivate.Deactivate(false); menuItemLicensing.Text = "Reactivate license for this computer..."; formOpenDentalA.isActivated = false; if (TurboActivate.GracePeriodDaysRemaining() == 0) { //ShowActivateMessage(true); } } else if (formOpenDentalA.isActivated == false) { menuItemLicensing.Text = "Deactivate license for this computer..."; formOpenDentalA.isActivated = true; TurboActivate.Activate(); // launch TurboActivate Process TAProcess = new Process { StartInfo = { FileName = Path.Combine(Path.GetDirectoryName(System.Windows.Forms.Application.ExecutablePath), "TurboActivate.exe") }, EnableRaisingEvents = true };
TAProcess.Exited += p_Exited; TAProcess.Start(); } }
======System.Exception was unhandled Message=Failed to deactivate. Source=Anesthesia7.9 StackTrace: at TurboActivate.Deactivate(Boolean eraseProductKey) at Anesthesia.FormOpenDentalA.menuItemLicensing_Click(Object sender, EventArgs e) at System.Windows.Forms.MenuItem.OnClick(EventArgs e) at System.Windows.Forms.MenuItem.MenuItemData.Execute() at System.Windows.Forms.Command.Invoke() at System.Windows.Forms.Command.DispatchID(Int32 id) at System.Windows.Forms.Control.WmCommand(Message& m) at System.Windows.Forms.Control.WndProc(Message& m) at System.Windows.Forms.ScrollableControl.WndProc(Message& m) at System.Windows.Forms.ContainerControl.WndProc(Message& m) at System.Windows.Forms.Form.WndProc(Message& m) at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m) at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m) at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam) at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg) at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData) at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context) at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context) at System.Windows.Forms.Application.Run(Form mainForm) at OpenDental.ProgramEntry.Main(String[] args) in C:\Users\wjs\Desktop\ODVersions\opendental7.9b\opendental7.9\OpenDental\Main Modules\ProgramEntry.cs:line 46 at System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args) at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args) at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly() at System.Threading.ThreadHelper.ThreadStart_Context(Object state) at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) at System.Threading.ThreadHelper.ThreadStart() InnerException: ==
Failing to deactivate can be caused by many things -- are you actually activated? I know "formOpenDentalA.isActivated == true", but is that value up-to-date? Also, did you change your date-time settings? That can cause problems too.
Failing to deactivate can be caused by many things -- are you actually activated?
Yes.
I know "formOpenDentalA.isActivated == true", but is that value up-to-date?
How would I know if it's up to date? If I run TurboActivate manually it shows I'm activated, and formOpenDentalA.isActivated (which is set to TurboActivate.IsActivated() ) is true.
Also, did you change your date-time settings? That can cause problems too.
Yes, I was doing some testing of military vs. non-military times on a project and needed to make sure that PM times were showing up properly. So I reset the clock on another development machine that pulls from the same license pool. I wasn't testing any of the licensing menu items then so I don't know if that's when the exception started but I'd have to assume so.
So how do I resolve it now? Will it just go away?
Change your date back to the correct date and restart your computer.
Change your date back to the correct date and restart your computer.
Oh, OK, then that's not the problem. That PC was reset to the correct date when I was done testing and has since been rebooted. And I'm seeing the problem on all the PCs here where the date was never changed. But they're all pulling from the same pool of licenses.
There isn't a problem on our servers. Everything is working fine here. Try calling IsGenuine() -- does it also fail?
There isn't a problem on our servers. Everything is working fine here. Try calling IsGenuine() -- does it also fail?
Yes, that throws a 'not activated' exception.
Hmmm.... I'm not sure what went wrong. This all worked before, correct? What have you done since it last worked? Did you delete the product key from LimeLM? Did you deactivate it from within your LimeLM dashboard? Or did you revoke your product key? Did you rework your code?
That is: what changed?
Also, are you using the latest version of TurboActivate.dll & .exe with your app? And are you using the latest TurboActivate.cs file?
I'm not sure either.
About a month or so ago, customers started coming off of 30 days trials and they would tell me they'd get this error. I didn't have time to fully investigate it then, the workaround to get them up and running was to just have them manually run TurboActivate to get them activated, but I haven't had a problem once they (or I) was activated running the 'Deactivate/Reactivate license on this computer' code until now. Right now it's throwing a 'The product key is invalid or there's no product key' exception.
Should I try revoking the product keys I was using for our in-house PCs to see if that works? I'm using the latest TurboActive.exe, .dll and TurboActivate.cs (2.13.0.0)
There are several problems with the code you posted. You shouldn't call TurboActivate.Activate() if you're using the TurboActivate wizard. Also, you shouldn't set "formOpenDentalA.isActivated = true;" without actually checking if the user activated.
See the example C# project for how you should write it.
Removing the TurboActivate.Activate() code did the trick.
Thanks.