c ++ / cli引用.net项目无法访问元数据 [英] c++/cli referencing .net project cannot access metadata

查看:599
本文介绍了c ++ / cli引用.net项目无法访问元数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我尝试使用c ++ cli项目中的ac#assembly,所以我将它作为项目引用,因为两者都在同一个解决方案中。


解决方案正确编译但我在c ++ cli项目中遇到此错误:"命令行错误:无法打开元数据文件"< c ++ cli projectpath> \c#assembly。 DLL"并且intellisense不显示来自c#程序集的东西。


看起来像visual studio正在c ++项目目录中查找程序集,显然它不是。


我通过将输出路径添加到"additionnal #using directories"来简单地工作。但后来我删除了它,然后再添加它,它甚至不再工作了。很奇怪......


我错过了什么吗?对我来说似乎更像是一个错误。


如果您有任何想法请告诉我,谢谢!

解决方案

< blockquote>


感谢您在此处发帖。


>>解决方案正确编译但我收到此错误在c ++ cli项目中:"命令行错误:无法打开元数据文件"< c ++ cli projectpath> \ c#assembly.dll"和intellisense不显示来自c#程序集的


你检查过你的C ++ / CLI项目属性 - > C / C ++ - > Advanced-> ;如果你在其中设置了元数据文件,强制#using文件属性?


>>我通过将输出路径添加到"additionnal#"来简化它使用目录"。但后来我删除了它,然后再添加它,它甚至不再工作了。很奇怪...


这对我来说听起来很奇怪。


您能否提供有关您问题的更多信息?你的vs版本是什么?


你确定已经将正确的路径添加到了另外的#using目录中吗?属性?


您是否尝试重新打开解决方案并重建它以查看它是否有效?


最好的问候,


Sera Yu



Hi,

I try to use a c# assembly from a c++ cli project, so I referenced it as a project since both are in the same solution.

The solution compiles correctly but I get this error in the c++ cli project : "command-line error: cannot open metadata file "<c++cli projectpath>\c#assembly.dll" and intellisense doesnt display stuff from the c# assembly.

Seems like visual studio is looking for the assembly in the c++ project directory, where obviously it is not.

I got it to work briefly by adding the output path to "additionnal #using directories". But then I removed it, then added it again, and it doesnt even works anymore. Weird...

Am I missing something? Seems more like a bug to me.

If you got any idea please let me know, thanks !

解决方案

Hi,

thanks for posting here.

>>The solution compiles correctly but I get this error in the c++ cli project : "command-line error: cannot open metadata file "<c++cli projectpath>\c#assembly.dll" and intellisense doesnt display stuff from the c# assembly.

Have you checked your C++/CLI project properties->C/C++->Advanced->Force #using file property if you have set the metadata file in it?

>>I got it to work briefly by adding the output path to "additionnal #using directories". But then I removed it, then added it again, and it doesnt even works anymore. Weird...

It sounds weird to me too.

Could you please provide more information about your problem? What's your vs version?

Did you make sure that you have added the right path into additionnal #using directories" property?

Have you tried to reopen your solution and rebuild it to see if it works?

Best Regards,

Sera Yu


这篇关于c ++ / cli引用.net项目无法访问元数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆