K
KalliMan
Hi all,
I’m trying to write a simple Office Addin using VS2005 (C#) and Shared Addin
Wizard(not VSTO). And everything looks OK, I am able to start and debug my
Addin. But the funs start here. I’ve added references both to EnvDTE and
EnvDTE80, but if I try to cast the “application†parameter (passed in
OnConnection method) to DTE(2) I receive an exception:
System.InvalidCastException: Unable to cast COM object of type
'System.__ComObject' to interface type 'EnvDTE.DTE'.
However in MSDN is written that the “application†parameter is DTE(2). What
I’m wrong? Should I leave this approach to create an Addin and use VSTO?
Thanks and Regards:
KalliMan
I’m trying to write a simple Office Addin using VS2005 (C#) and Shared Addin
Wizard(not VSTO). And everything looks OK, I am able to start and debug my
Addin. But the funs start here. I’ve added references both to EnvDTE and
EnvDTE80, but if I try to cast the “application†parameter (passed in
OnConnection method) to DTE(2) I receive an exception:
System.InvalidCastException: Unable to cast COM object of type
'System.__ComObject' to interface type 'EnvDTE.DTE'.
However in MSDN is written that the “application†parameter is DTE(2). What
I’m wrong? Should I leave this approach to create an Addin and use VSTO?
Thanks and Regards:
KalliMan