tags:

views:

289

answers:

3

I have a C++ assembly with both managed and umanaged code compiled to a DLL. It is correctly imported into the project references as I can see all my classes and their members with the Object Browser.

The problem is with the XAML Design view. In my XAML code I want to make a data bind with my C++ assembly so I have the namespace like so:

xmlns:kudu="clr-namespace:kudu;assembly=CLI"

CLI is the name of the dll and it has a namespace inside called kudu. The Design view refuses to shows the XAML and gives me this error:

Assembly 'CLI' was not found. Verify that you are not missing an 
assembly reference. Also, verify that your project and all referenced
assemblies have been built.

The best part is I can actually build the entire solution and everything works! The window updates as the C++ objects change and what not. However with out the Design view this makes continuing development quite difficult.

Does anyone have an answer as to why this happens and how I can fix it?

+1  A: 

This is probably happening because the ide cannot load one of the unmanaged dll's. You may have to move them into the windows/system32.

Aaron Fischer
I tried moving the other DLLs that this assembly needs to run to system32 but no such luck. Still same problem loading error.
Jippers
Sorry, I take that back. I must have missed a file because I tried again with copying all our unmanaged DLLs to system32 and it works! THANK YOU!!!!
Jippers
+1  A: 

An alternative solution I've found to this is add to the windows PATH variable the bin directory of my assembly which has all the DLLs.

Jippers
A: 

Very helpful, thanks for this insight.

My solution is to copy the DLLs into the output directory using a Post-Build event. Here's how 1. Project Properties / Build Events 2. Set Post-build event command line:

copy path_to_dependent_dlls .

Oh, and I find that a VStudio restart is required for it to start working ...