private static void LogExceptionToActivityLog(Exception exception) { ThreadHelper.ThrowIfNotOnUIThread(); var vsActivityLog = VisualStudioServiceGateway.GetActivityLogService(); vsActivityLog.LogEntry((uint)__ACTIVITYLOG_ENTRYTYPE.ALE_ERROR, ProductConstants.ToolName, exception.ToString()); }
public string FindByAssemblyName(string assemblyName) { var workspace = VisualStudioServiceGateway.GetWorkspace(); var currentSolution = workspace.CurrentSolution; if (currentSolution == null) { throw new Exception("Cannot acquire CurrentSolution."); } var projectFilePath = currentSolution.Projects.FirstOrDefault(i => i.AssemblyName == assemblyName)?.FilePath; LogTraceMessage($"Project file path for '{assemblyName}' is '{projectFilePath}'."); return(projectFilePath); }