VS2008 XAML design view chokes on namespaced C++ assembly

拟墨画扇 提交于 2019-12-08 04:15:58

问题


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:


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.




回答2:


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.




回答3:


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 ...



来源:https://stackoverflow.com/questions/278416/vs2008-xaml-design-view-chokes-on-namespaced-c-assembly

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!