by saying `var context = sctx as EnvDTE.SolutionContext;` you are implying that `sctx` may not be a  `SolutionContext` and hence this `as` could result in a null. but then you dont do a null check. please either add a null check or do an explicit cast.