I’ve recently faced an issue while deploying the Plugin using Developer Toolkit (using VS 2015). The issue was with ‘Deploy‘ step in the Development Toolkit.
I’ll not be covering the information on how to configure Development Toolkit in Visual Studio and how to create Plugin Library or CRM Package. You can refer to the following blogs –
- Download Link for CRM Development
- HOSK’S blog – Information on how to Configure CRM Development Toolkit (with video)
Now, let’s talk about the common issue that most of the CRM developers might have faced while deploying the plugin using toolkit.
“Cannot Insert Duplicate Key“
Steps, I followed to get rid of this issue –
- I clicked on build solution option in Visual Studio and there was no errors in the code and thought ‘YEAH‘ no errors but when I clicked on Deploy option there was one error “Cannot Insert Duplicate Key“.
I already edited the name of the class while registering the plugin and I knew that there’s no plugin with the same class name.
2. I then checked the Plugin Registration tool to find out if it may have registered the Assembly and the Plugin step but not updating the RegisterFile.crmregister in Visual Studio.
I was right the Assembly was registered but due to some reasons the Development Toolkit hasn’t updated the IDs. So, I copied the following IDs from the Plugin Registration Assembly Properties into RegisterFile.crmregister file in Visual Studio.
Assembly Tag ID in RegisterFile.crmregister is Assembly ID in Plugin Registration Tool under Properties tab.
Plugin Description Tag ID in RegisterFile.crmregister is Plugin ID in Plugin Registration Tool under Properties tab.
Step Customization Tag ID in RegisterFile.crmregister is Step ID in Plugin Registration Tool under Properties tab.
3. After copying the values, I deployed the solution and it got updated without any issues.
If you enjoyed this post, I’d be very grateful if you’d help it spread by emailing it to a friend, or sharing it on LinkedIn, Twitter or Facebook. Thank you!