user1811305
user1811305

Reputation: 41

CRM Plugin deployment

I have created a crm plug library (dll) and then added this dll to CRM package for deployment.

I want to add 6- 7 steps for plugin.

1) Is there is any way to added steps for plugin using visual studio. We can do using plugin registration tool.

2) How to debug the plugin. (onpremise and crm online)

Upvotes: 2

Views: 1624

Answers (3)

Abhishek Sharma
Abhishek Sharma

Reputation: 1

Sample Code For Plugin Steps :

<PluginStep
Message="Create"
Entity="contact"
PrimaryEntityName="contact"
SecondaryEntityName=""
Stage="PreValidation"
ExecutionMode="Synchronous"
Description="My Plugin Step"
PluginType="MyPlugin"
AssemblyName="MyPlugin.dll"
TypeName="MyPlugin.MyPluginClass"
/>

Instructions:

  • Save the pluginregistration.xml file and build the project.

  • Deploy the plugin and its steps using the CRM Developer Toolkit.

  • Debugging the Plugin:

    Attach Visual Studio to the w3wp.exe process running on the CRM server. You can do this by going to Debug > Attach to Process, selecting w3wp.exe, and clicking Attach.

    Set breakpoints in your plugin code.

    Trigger the plugin action in CRM to start the debugging process.

    Once the breakpoint is hit, you can step through the code and debug any issues.

  • For CRM Online, you will need to use remote debugging to attach to the CRM server process. You can find detailed instructions on how to do this in the Microsoft Dynamics CRM SDK documentation.

  • Note that debugging a plugin in a production environment is not recommended, as it can impact performance and stability. It is recommended to test and debug plugins in a development or test environment before deploying to production.

Go through with Official documentation for more information -

Register plug-in: https://learn.microsoft.com/en-us/power-apps/developer/data-platform/register-plug-in

Debug plug-in: https://learn.microsoft.com/en-us/power-apps/developer/data-platform/tutorial-debug-plug-in?tabs=prt

Upvotes: 0

Pedro Azevedo
Pedro Azevedo

Reputation: 2507

You can register if you build your own registation tool, directly with visual studio you can't.

  • See here a resume how debug a plugin in all configuration situations (online, offline, sandbox or asynchronous registered plug-ins).
  • See here how debug with registation tool.
  • See here how remote debug.
  • See here to debug crm online, using ITracingService, isn't step by step but is useful to debug.

Upvotes: 1

Darren Lewis
Darren Lewis

Reputation: 8508

If you install the Developer Toolkit available in the CRM SDK you'll get a range of tooling added to Visual Studio that includes the ability to develop and deploy all the main CRM 2011 assets including plugins, workflows, web resources etc. As of the latest SDK release the tooling now supports Visual Studio 2010 and 2012 via separate installers.

A key part of the tooling is the CRM Explorer that gets integrated into Visual Studio. From this you can browse all of the entities within an organisation and generate stub code for plugins directly within Visual Studio. Once the plugin has been deployed you can then use the CRM Explorer to add additional steps.

The SDK has a good README included in the install folder for the toolkit. Have a read of that.

To debug plugins on-premise, if running CRM locally you need to attach to w3wp.exe if running without isolation otherwise attach to the sandbox process (the full name of the process eludes me). The toolkit makes debugging easier as it ensures your PDB files are available.

You can't debug plugins deployed to CRM Online.

Upvotes: 2

Related Questions