I have been tasked with bringing our 2008 CRM server into the modern age of Microsoft Dynamics 365 on-premises. I have got a plugin working and java script which is my first task and debugging/remote debug is working too. I can also make changes to the DLL and the changes work. However I am really concerned with how long winded the process to publish the DLL to the server is and wondered if am missing something. Watched quite a few videos, googled a lot but everyone seems to cover getting it working and that's it.
I note during Registration there is an option to select 'Disk' for the location of the DLL but this just crashes when i select it? so I am having to select 'Database'
Initial setup:
Currently my development workflow is:
The ONLY way I have been able to get this working and it seems there must be an easier way:
This seems a real PIA if you need to rapidly change rebuild test which I suspect I will need to.
Is there an easier way?
Plugin publishing and debugging can be a challenge for sure.
As far as publishing goes, I use the commercial 3rd Party Visual Studio extension XrmToolkit (no affiliation), which is not to be confused with the wildly popular community-supported XrmToolbox app.
XrmToolkit enables you to configure, build, and publish a plugin directly from Visual Studio. This greatly streamlines the process of publishing updates.
Microsoft used to have a Developer Extensions tool, and Jason Lattimer had one too, but I'm not sure if either of those are in active development anymore.
Another technique that I generally employ is to put the plugin code into a Visual Studio Shared Project, which I reference from both the plugin project and a Console App. I use the Console App to develop and debug before publishing the plugin. After the plugin goes live, I'll continue using the Console App to troubleshoot or build enhancements.
For Example:
///Shared Project
public class MyPluginApp
{
private IOrganizationService svc;
public MyPluginApp(IOrganizationService svc)
{
this.svc = svc;
}
public void Run(Account target)
{
//do stuff with the Target
}
}
////Plugin
public void Execute()
{
var app = new MyPluginApp(context.Service);
app.Run(context.Target);
}
///Console App
public static void Main()
{
var svc = new CrmServiceClient(connectionString);
var target = getLastTouchedAccount(svc);
var app = new MyPluginApp(svc);
app.Run(target);
}
Please also see this answer.