protected string GetContext() { try { string context = "\n\n\nError context:"; context += "\nSolution: " + VisualStudio.GetSolutionName(); var codeFile = VisualStudio.GetCurrentCodeFile(); if (codeFile != null) { context += "\nCurrent file: " + codeFile.FilePath; context += "\nLineNumber: " + VisualStudio.GetCurrentLine(); context += "\nCursor position: " + VisualStudio.GetCursorPositionInLine(); } else { context += "\nCurrent file: <none>"; } context += "\n\n"; return(context); } catch (Exception) { return("<exception during GetContext()>"); } }