I'm new to custom workflow activities in Dynamics CRM 2016. I'm trying to download an image from url in the code below, the workflow is deployed in Dynamics crm online 2016. When I try to debug in visual studio the Plugin Registration Tool crashes without showing any errors at this line:
byte[] imageBytes = client.DownloadData(imageUrl);
Code:
private string ConvertImageToBase64(string imageUrl)
{
var base64String = string.Empty;
using (WebClient client = new WebClient())
{
byte[] imageBytes = client.DownloadData(imageUrl);==== Fails here.
base64String = Convert.ToBase64String(imageBytes);
}
return base64String;
}