Author Topic: Visual studio crashes when DLL added in VS2017  (Read 32678 times)

Damo

  • Administrator
  • Newbie
  • *****
  • Posts: 11
    • View Profile
    • Quantum-key.Net
Visual studio crashes when DLL added in VS2017
« on: May 30, 2018, 02:05:40 pm »
I'm trying to ad the DLL to Visual Studio, but its not working, and just crashes VS. Please help with any solution. Thanks!
« Last Edit: June 01, 2018, 12:16:30 am by Damo »

Damo

  • Administrator
  • Newbie
  • *****
  • Posts: 11
    • View Profile
    • Quantum-key.Net
Re: Visual studio crashes when DLL added
« Reply #1 on: May 30, 2018, 02:08:37 pm »
Visual Studio may crash if you try to debug when the DLL is added and is more prevalent in later versions of visual studio.  This is a security feature which stops snooping and tampering of the inner workings of the key system.  Only add the DLL when you have completed your software.  It should be the final stage when you are ready to release your application.  Visual studio 2013 (and possibly 2015) is less likely to have this issue so you can use that if you don't need the additional features of 2017 as it will be easier for you to develop
« Last Edit: June 01, 2018, 12:19:40 am by Damo »

Modulus

  • Guest
Re: Visual studio crashes when DLL added
« Reply #2 on: May 31, 2018, 09:47:12 am »
So, once I upload my program to Quantum-key, I add the .DLL, and it shouldn't crash?

Damo

  • Administrator
  • Newbie
  • *****
  • Posts: 11
    • View Profile
    • Quantum-key.Net
Re: Visual studio crashes when DLL added
« Reply #3 on: May 31, 2018, 10:45:51 am »
Try going to your project debug or release folders and running the exe file directly and see what happens.  It should run fine like this but if you try to debug the DLL through Visual studio it should crash or throw an error because the copy-protection system will prevent it from being debugged

Damo

  • Administrator
  • Newbie
  • *****
  • Posts: 11
    • View Profile
    • Quantum-key.Net
Re: Visual studio crashes when DLL added
« Reply #4 on: May 31, 2018, 02:07:25 pm »
Please download the latest version of the DLL to address this issue and let us know if you have any more problems.  You should now be able to add the DLL as a reference in VS2017 community edition.  You will however not be able to debug any of the LicenceKey methods as it will cause a 'fatal error' exception in VS due to the copy protection.  All you need to do is comment out the calls to LicenceCheck until you are ready to build your final release version.  At this point you can uncomment the LicenceCheck code and build the release version.  You will then be able to launch your application by running the executable from within the bin\release folder of your project and it will run as normal with the licence check included.  If this all works ok then you can replace the KMSC.dll file with the release version of the KMSC dll.  Zip the release files up and upload them to the website and all should be good.

The code you should comment out until you are ready to build the release version is this (copied from quantum-key.net home page https://quantum-key.net):

LicenceCheck licenceCheck = new LicenceCheck();
licenceCheck.ShowDialog();
if (!licenceCheck.IsClosing)
{
    if (licenceCheck.IsLicenceValid)
    {
       // code to launch full version of your software
    }
    else
    {
        // code to launch demo version of your software
    }
}

« Last Edit: May 31, 2018, 10:36:53 pm by Damo »

 

SMF spam blocked by CleanTalk