VS2008 XAML 设计视图在命名空间 C++ 集会
我有一个 C++ 程序集,其中托管和非托管代码均编译为 一个DLL。 它已正确导入到项目参考中,我可以 使用对象浏览器查看我的所有类及其成员。
问题出在 XAML 设计视图上。 在我的 XAML 代码中我想要 与我的 C++ 程序集进行数据绑定,这样我就有了这样的命名空间:
xmlns:kudu="clr-namespace:kudu;assembly=CLI"
CLI 是 dll 的名称,它内部有一个名为 kudu 的命名空间。 设计视图拒绝显示 XAML 并给我这个错误:
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.
最好的部分是我实际上可以构建整个解决方案并且 一切正常! 窗口随着 C++ 对象的变化而更新 什么不。 然而,如果没有设计视图,这使得继续 发展相当困难。
有谁知道为什么会发生这种情况以及我该如何解决 它?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我发现的另一种解决方案是将包含所有 DLL 的程序集的 bin 目录添加到 Windows PATH 变量。
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.
发生这种情况的原因可能是 ide 无法加载非托管 dll 之一。 您可能需要将它们移至 windows/system32 中。
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.
非常有帮助,感谢您的见解。
我的解决方案是使用构建后事件将 DLL 复制到输出目录中。
就是这样
1. 项目属性/构建事件
2. 设置构建后事件命令行:
复制 path_to_dependent_dlls 。
哦,我发现需要重新启动 VStudio 才能开始工作......
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 ...