0

I am trying to create some custom tool windows for my isolated shell (VS2010). Below is the code for toolwindow.

[Guid("xxxx")]
public class ToolWindow1: ToolWindowPane
{
    public ToolWindow1()
        : base(null)
    {
        this.Caption = "BAM0";
    }
}

I am trying to open the tool window via

[ProvideToolWindow(typeof(ToolWindow1))]
...
ToolWindowPane window = this.FindToolWindow(typeof(ToolWindow1), 0, true);

However, I am getting a TargetInvocationException on FindToolWindow call, and I'm not sure why. Am I missing something in displaying a custom tool window?

Thanks!

Edit: my project references weren't set up properly. I ended up merging the two projects, and the tool window is now showing up properly.

Jin
  • 6,055
  • 2
  • 39
  • 72
  • What is the inner exception in the `TargetInvocationException` message? – JaredPar Jul 11 '12 at 20:20
  • Sorry, how can I get the inner exception? – Jin Jul 11 '12 at 20:24
  • if you run this under the debugger you can expand the `TargetInvocationException` and see the `InnerException` property – JaredPar Jul 11 '12 at 20:25
  • I can't find how to expand the TargetInvocationException, but I changed some debugger setting and found this: First-chance exception at 0x77797945 in WPPerfMonShell.exe: Microsoft C++ exception: EEFileLoadException at memory location 0x0061b99c.. – Jin Jul 11 '12 at 20:28
  • that's unlikely to be the cause. Try putting a `try / catch` aronud the `FindToolWindow` call and seeing what exception comes out of it. – JaredPar Jul 11 '12 at 20:32
  • Got it. - Could not load file or assembly 'WPPerfMonUserControl, or one of its dependencies. The system cannot find the file specified} – Jin Jul 11 '12 at 20:38
  • 1
    is that your assembly? If so the most likely problem is the code base isn't registered and it's failing trying to find your tool window type via reflection like APIs – JaredPar Jul 11 '12 at 20:40

0 Answers0