public class SolutionEvents : IVsSolutionEvents3 { } SolutionEvents solutionEvents = new SolutionEvents(); IVsSolution solution = this.GetService(typeof(SVsSolution)) as IVsSolution; uint mySolutionEventsCookie = 0; if (solution != null) { int adviseSolutionResult = solution.AdviseSolutionEvents(solutionEvents, out mySolutionEventsCookie); if (adviseSolutionResult != VSConstants.S_OK) { Trace.TraceWarning(Localizable.AdviseSolutionEventFailed); } }