I suggest you ...

Rewrite your DTE code so that property references do not cause an exception.

Rewrite your DTE code so that property references do not cause an exception.

Example: if (dte.ActiveSolutionProjects != null){...}
This throws a Com exception if no solution is loaded into the environment. Instead, as a property reference is should return a null value when ActiveSolutionProjects has no value. I can wrap this in an exception handler but that can become very expensive in terms of performance.
A little bit of defensive programing on the VS DTE side of things would go a long way. Com Interop does not have to fail this way!!!

1 vote
Vote
Sign in
(thinking…)
Sign in with: facebook google
Signed in as (Sign out)
You have left! (?) (thinking…)
Ibrahim shared this idea  ·   ·  Flag idea as inappropriate…  ·  Admin →

0 comments

Sign in
(thinking…)
Sign in with: facebook google
Signed in as (Sign out)
Submitting...

Feedback and Knowledge Base