I have a C# project with a UserControl in it.
This user control depends on a particular C++ Mixed mode dll which in turns, acts as a facade to an unmanaged C++ DLL
C# C++ Mixed C++ Umnanaged
[ main app ] ---> [ myUC ] ---> [ OCShell.dll ] ---> [ OCC.dll ]
In the Design View, I cannot add the UserControl. It says that there is a FileNotFoundException on OCShell (or one of its dependency). However, via code, everything works fine. In main app (windows form) I can
myUC uc = new myUC();
this.Controls.Add(uc);
and this works fine. The right code gets executed properly.
I checked with Dependency Walker and everything is ok. Everything gets properly copied to the Bin\Debug\ directory and each of those DLL sees each other.
My guess is that the Design View Editor does not check the proper paths for those DLL and thus returns an error.
I also tried copying every dll to every possible directory in my solution but that didn't help either