Visual Studio 2010 中没有 C++/CLI 的 IntelliSense?
我刚刚从 Visual Studio 2008 迁移到 Visual Studio 2010(最终版)并注意到一个主要缺陷:
当我尝试在托管 C++ 的 C++ 源文件中使用自动完成功能时,页脚中出现小注释:
C++/CLI 的 IntelliSense 不可用
呃,C++/CLI 的 IntelliSense 是否已从 Visual Studio 2010 中删除?有什么办法可以恢复这个吗?它相当有用......
I just moved from Visual Studio 2008 to Visual Studio 2010 (final) and noticed one major flaw:
When I try to use AutoComplete in a C++ source file for managed C++, a small note in the footer appears:
IntelliSense for C++/CLI is not available
Uh, has IntelliSense for C++/CLI been dropped from Visual Studio 2010? Is there any way to get this back? It is rather useful...
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(7)
你是对的。不幸的是它已经被放弃了。您可以在 Microsoft Connect 网站上查看此未解决的问题。
为了得到答案,我只是引用它们:
关于恢复智能感知,您现在最好的机会是使用第三方工具,例如 VA Assist。我已经用 Visual Studio 2008 进行了尝试,它的 IntelliSense 比默认的要好很多。
它在 Visual Studio 2012 中再次提供。
You are correct. Unfortunately it has been dropped. You can check this opened issue on Microsoft's Connect website.
I'll just quote them for the sake of the answer:
About getting back intellisense, your best chances for now are using third-party tools like VA Assist for example. I've tried it with Visual Studio 2008 and its IntelliSense is a whole lot better than the default one.
It is available again in Visual Studio 2012.
如果您想恢复 IntelliSense,请安装 Whole Tomato Software 的 Visual Assist X。在这里您可以获得 30 天的试用来检查智能感知。
If you want to get IntelliSense back, install Visual Assist X from Whole Tomato Software. Here you can get a 30-days trial to check the intellisense.
根据 Visual C++ 团队博客,C++/CLI Intellisense 将在 Visual Studio 的下一版本中,但不在 VS2010 的服务包中。该博客文章还详细说明了问题所在并导致了这种悲伤的状态。
According to the Visual C++ Team Blog, C++/CLI Intellisense will be in the next version of Visual Studio, but not in a service pack for VS2010. That blog post also gives some detail as to what went wrong and led to this sad state.
我不知道您是否可以使用此设置,但它对我有用。我只检查使用它的 cpp 文件的公共语言运行时支持。我不会对整个项目进行检查,并且我对所有不使用 CLI 的文件都有智能感知。
I don't know if you can use this settings but it work for me. I only check the Common Language RunTime Support for the cpp files that use it. I do not check it for the whole project and I've got intellisense for all the files that don't use the CLI.
是的!您可以启用 IntelliSence,但方式比较棘手。请按照以下说明操作:
项目资源管理器,然后选择属性。或者简单地 Alt + Enter)
并将其更改为“无公共语言运行时支持”。
现在 IntelliSence 正在工作。但问题是编译代码时出现错误! (错误是:错误 LNK1123:转换为 COFF 期间失败:文件无效或损坏)
您只需返回“项目属性”,将“公共语言运行时支持”更改为“公共语言运行时支持,旧语法( /clr:旧语法)”。
祝你好运。
Yes! you can enable the IntelliSence, but in a tricky way. Follow these instructions:
Project Explorer, and select Properties. or simply Alt + Enter)
and change it to "No Common Language Runtime Support".
Now the IntelliSence is working. But a problem is an error when you compile your code! (The error is: error LNK1123: failure during conversion to COFF: file invalid or corrupt)
You can simply go back to Project Properties an change Common Language Runtime Support to "Common Language Runtime Support, Old Syntax (/clr:oldSyntax)".
Good luck.
仅当您不需要公共语言运行时
时才使用此解决方案
它在 VS2010
中对我有用
转到项目属性>配置属性>一般>公共语言运行时支持并将其设置为无公共语言运行时支持。
点击应用按钮后即可正常工作。
This solution is only if you don't want Common Language Runtime
It worked for me in VS2010
Go to Project Propreties > Configuration Properties > General > Common Language Runtime Support and set it to No Common Language Runtime Support.
This will work fine just after hitting Apply button.
如前所述,您可以安装一些付费软件,例如“来自 Whole Tomato Software 的 Visual Assist X”。
或者
您可以使用包含 intellisense* 的开源工具,其中一种工具是 Qt Creator 3.3.1(开源)。您有两个选择,要么使用 Qt 设置整个项目以使用 VS2010 编译器进行编译,要么使用 Qt 链接到源文件并使用 VS2010 进行编译。您在 Qt 中编写代码,保存,将窗口翻转到 vs2010 并编译和调试。
当Qt中保存更改后,vs2010会自动重新加载项目中的源文件,然后就可以编译了。
As mentioned you could install some paid software such as "Visual Assist X from Whole Tomato Software".
or
You could use open source tools that contain intellisense*, one such tool is Qt Creator 3.3.1 (opensource). You have two options, either setup your entire project with Qt to compile using VS2010 compiler, or use Qt to link to your source files and compile with VS2010. You write your code in Qt, save, flip windows to vs2010 and compile and debug.
When changes are saved in Qt, vs2010 will automatically reload the source file in the project and you can compile.