Skip to content

Instantly share code, notes, and snippets.

@patkleef
Created March 19, 2017 18:40
Show Gist options
  • Select an option

  • Save patkleef/11dca1955ca3513f4151f7caa2822197 to your computer and use it in GitHub Desktop.

Select an option

Save patkleef/11dca1955ca3513f4151f7caa2822197 to your computer and use it in GitHub Desktop.
Application Insights Blog - ApplicationInsightsHomeActionMethod.cs
public ActionResult Index()
{
var arr = new string[2];
try
{
arr[0] = "value 1";
arr[1] = "value 2";
arr[2] = "value 3";
var result = arr[3];
}
catch (Exception ex)
{
var dic = new Dictionary<string, string>();
dic.Add("variable: arr", string.Join(",", arr));
_telemetryClient.TrackException(ex, dic);
}
return View();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment