Yup, I also had this. Might be too late to help, but here you go:
var errorList = _dte.ToolWindows.ErrorList as IErrorList;
// placed in dictionary for easy access later
var entries = (errorList?.TableControl.Entries ?? Enumerable.Empty<ITableEntryHandle>())
.Select((e, i) => new { Entry = e, Index = i + 1 })
.ToDictionary(it => it.Index, it => it.Entry);
var errors = errorList.ErrorItems;
for (int i = 1; i <= errors.Count; i++)
{
ErrorItem error = errors.Item(i);
entries[i].TryGetValue("errorcode", out var errorCode);
var item = new
{
error.Column,
error.Description,
error.ErrorLevel,
error.FileName,
error.Line,
error.Project,
Code = errorCode
};
}
it works on my solution which was build on visual studio 2022
var dte = (EnvDTE.DTE)System.Activator.CreateInstance(t, true) as EnvDTE80.DTE2;
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.