views:

20

answers:

1

I try to use the Addin from VisualNDepend in Visual Studio 2010, but when I open Visual Studio 2010 I always get the following error message.

************** Exception Text **************
Exception on Addin.Connect.OnConnection()
Exception in NDepend v3.0.3.4916
.NET Fx Version: 4.0.30319.1
OS Windows Version: 6.1.7600.0
Processor Architecture: x64
Execution Environment: Hosted in VisualStudio v10.0
Error Hash: 3.0.3.4916 PRO 2A215D8F System.InvalidCastException
LicenseId: 

Exception.Type {System.InvalidCastException}
Exception.Message {Unable to cast COM object of type 'System.__ComObject' to interface type 'Microsoft.VisualStudio.CommandBars.CommandBarControl'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{43FD5911-7BAC-4BDC-AB6C-2DE65B5C0233}' failed due to the following error: No such interface supported (Exception from HRESULT: 0x80004002 (E_NOINTERFACE)).}
Exception.StackTrace {
 ff.a()
 abz..ctor(DTE2 A_0, aon A_1, ajx A_2)
 zo..ctor(AddIn A_0, DTE2 A_1, aon A_2)
 NDepend.AddIn.VisualStudio.V3.Connect.a(AddIn A_0, DTE2 A_1)
 NDepend.AddIn.VisualStudio.V3.Connect.a(Object A_0, ext_ConnectMode A_1, Object A_2, Array& A_3)
 NDepend.AddIn.VisualStudio.V3.Connect.b(Object A_0, ext_ConnectMode A_1, Object A_2, Array& A_3)}

Exception.InnerException = null

I already stayed in contact with the Support of VisualNDepend, but they couldn't helped me either. Does anybody of you has an idea why this could fail?

alt text

A: 
  • Could you try with the last v3.1.0 version where several bugs have been fixed?
  • Could you make sure the NDepend files in your NDepend installation are not blocked by Window?
  • Could you try having only the NDepend adin installed in VS? Does it work with VS 2008?

Actually I am surprised the support didn't help you (I work there), we are committed to fix all bug reported.

Patrick Smacchia - NDepend dev
Hi Patrick, yes indeed - we had a mail conversation at the 26th May this year. But you stated: "We never observed this bug. We take note and will come back to you with a fix within the next weeks." So If you could help me now - it really would be great.
BitKFu
But to answer your questions. 1.) v.3.1.0 does not fix that bug, but it only appears in the status line of VS 2010 that says:"NDepend addin failed to load because of VS bug, please reload the Addin manually or restart VS". Which I think it's the same error as before, but without showing a dialog. 2.) No - all files are available and not blocked. 3.) Yes it works with VS 2008 like a charme.
BitKFu
"NDepend addin failed to load because of VS bug, please reload the Addin manually or restart VS" in VS status bar is indeed a report we added in v3.1.0 instead of letting an exception show up to the user.
Patrick Smacchia - NDepend dev
Concerning the VS bug problem, I am afraid we cannot do much about it. We are calling some VS addin initialization API and it seems to fail permanently on your VS 2010 install.
Patrick Smacchia - NDepend dev
did you try reload the addin manually? did you try on another machine with VS 2010 install?
Patrick Smacchia - NDepend dev
I will try it this evening, but don't you have any idea why this can happen? I can't believe that I should be the only one who has that kind of problem.
BitKFu
Only to clarify that: I already use ReSharper Addin, VSCommands Addin and some other Addins too without any problem.
BitKFu
This problem happens very rarely (less than 1 / 10K runs from our stats) and indeed, your machine represents the only occurence the NDepend Team know, where the bug manifests each time VS 2010 starts. Could you try desinstall some other Addin?
Patrick Smacchia - NDepend dev