Reputation: 85
To start out with, I'm looking for a way to unregister all plugins and delete the workflows in a specific environment then import the customizations.
what is the easiest way to un register plugins?
I have been doing a lot of research on this, but I can not find any working examples, so any help would be amazing.
Upvotes: 2
Views: 848
Reputation: 2175
I know this is quite old now, but I would suggest taking a look at this open source library I have recently developed to solve this problem. You can find it here: http://dazinator.github.io/CrmUp/
Upvotes: 0
Reputation: 8488
The developer toolkit extension for Visual Studio (available in the SDK) installs a custom MSBuild target file and assembly with the required tasks. I don't have it installed on this machine but I think the target file is called Microsoft.CrmDeveloperTools.targets
. Search your Program Files (x86) folder for *.targets.
If you're comfortable with MSBuild you could have a poke around to see what you can reuse or extend as required. It will also hook nicely back into VS or any automated build system you may be running.
Alternatively or in combination with the above, the source code for the Plugin Registration Tool is also included in the SDK.
Upvotes: 0
Reputation: 17552
I would suggest having a look at this article: Register Plug-ins Programmatically.
In particular:
The key entity types used to register plug-ins and images are: PluginAssembly, PluginType, SdkMessageProcessingStep, and SdkMessageProcessingStepImage. The key entity types used to register custom workflow activities are PluginAssembly and PluginType. Use these entities with the create, update, retrieve, and delete operations. For sample code showing the use of these classes, see the Plug-in Registration tool source code.
Now I don't actually know for certain where this source code is, it used to be in the SDK, but I've just had a quick snoop around the CRM 2011 SDK and couldn't find it. (Microsoft used to ship just the source and people had to build it, now it appears they may just ship the binary).
In any case I believe you should be able to find the source in one of these locations, you might just have to dig around for it a little bit.
Upvotes: 2
Reputation: 39058
Depending on your definition of easiest way, and the number of plugins you have to unregister, using the plugin registration tool is probably the safest bet.
Upvotes: 0