I have created a plugin which get activated when on create record.
And in plugin i am calling a REST api. it run very well in a simple application console
But when i am calling in plugin like below
public string MakeRequest(string parameters)
{
var request = (HttpWebRequest)WebRequest.Create(EndPoint + parameters);
request.Method = Method.ToString(); //get
request.ContentLength = 0;
request.ContentType = ContentType;
using (var response = (HttpWebResponse)request.GetResponse())//*******
{
var responseValue = string.Empty;
if (response.StatusCode != HttpStatusCode.OK)
{
var message = String.Format("Request failed. Received HTTP {0}", response.StatusCode);
throw new ApplicationException(message);
}
// grab the response
using (var responseStream = response.GetResponseStream())
{
if (responseStream != null)
using (var reader = new StreamReader(responseStream))
{
responseValue = reader.ReadToEnd();
}
}
return responseValue;
}
}
But its not running and when i am debugging it comes on //******* it getting stop and my Plugin Registration Tool also get crashed.
If it don't get crash i can get the exception but due to that i am unable to catch the cause.
some one can help me
tnx
*This post is locked for comments