I have created a custom UserControl in Managed C++ that wraps some native code controls. I have confirmed the control works at runtime, and have been trying to make the control work with the Visual Studio designer by allowing drag and drop of the control from the designer toolbox.
While I have successfully added the UserControl to the toolbox, nothing happens when I drag the control onto a windows form. To investigate the problem, I opened a second Visual Studio 2008 instance and attached its debugger to the devenv.exe instance where I am attempting to use the UserControl. After dropping the UserControl onto the windows forms, the Visual Studio debugger outputs a FileNotFoundException in mscorlib.dll when trying to load the module containing the UserControl.
I noticed that the designer does not load the dll from the project's output path, but rather creates a copy of the assembly in the %UserData%\VisualStudio\9.0\ProjectAssemblies\*RandomFolderName* folder. However, none of the module's dependencies are copied, which I believe is the source of the FileNotFoundException.
Any ideas how to resolve this issue? Ideally Vistual Studio would copy all the assembly's dependencies when copying the dll to the ProjectAssemblies folder, but I can't figure out any way to make this happen.