Background
I have a C# plugin in Dynamics 2016 on-premise that uses a library to make calls to other systems. Part of that library is a call to dynamics using the Web API. The Plugin is taking action as I can see the changes in dynamics, however I am expecting it to take a different action than it is taking. When I try to debug the plugin using the Plugin Registration tool, I am running into some issues. When I profile the plugin using the Exception method, I get an exception file that I am able to debug through to a point. When I get to the below code, the Plugin Registration Tool crashes without an error message. When I debug using the Persist to Entity Method, my plugin appears to succeed, but no Profiles are logged in the Plugin Registration Tool. My plugin is fired from an action which is triggered from a workflow that is attached to the completion of a Business Process Flow (this is based on this article). My initial question is here which led to this question. Any thoughts on getting the debugger to work with my code?
Code
HttpClient client = new HttpClient(new HttpClientHandler() { Credentials = new NetworkCredential("admin", "password", "DOMAIN") });
client.BaseAddress = new Uri(Helpers.GetSystemUrl(COHEN.APIConnector.Application.Dynamics));
client.DefaultRequestHeaders.Clear();
client.DefaultRequestHeaders.Accept.Add(new System.Net.Http.Headers.MediaTypeWithQualityHeaderValue("application/json"));
client.DefaultRequestHeaders.Add("OData-MaxVersion", "4.0");
client.DefaultRequestHeaders.Add("OData-Version", "4.0");
HttpResponseMessage responseMessage;
string url = "ccseq_clients";
responseMessage = client.GetAsync(url).Result;