visual-studio Visual Studio 2010 中没有用于 C++/CLI 的 IntelliSense?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/2681999/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
No IntelliSense for C++/CLI in Visual Studio 2010?
提问by Sam
I just moved from Visual Studio 2008to Visual Studio 2010(final) and noticed one major flaw:
我刚刚从Visual Studio 2008迁移到Visual Studio 2010(最终版)并注意到一个主要缺陷:
When I try to use AutoComplete in a C++ source file for managed C++, a small note in the footer appears:
当我尝试在托管 C++ 的 C++ 源文件中使用 AutoComplete 时,页脚中出现一个小注释:
IntelliSense for C++/CLI is not available
IntelliSense for C++/CLI 不可用
Uh, has IntelliSense for C++/CLI been dropped from Visual Studio 2010? Is there any way to get this back? It israther useful...
呃,是否已从 Visual Studio 2010 中删除了用于 C++/CLI 的 IntelliSense?有什么办法可以恢复这个吗?这是相当有用...
采纳答案by Ivan Zlatanov
You are correct. Unfortunately it has been dropped. You can check this opened issue on Microsoft's Connect website.
你是对的。不幸的是它已被丢弃。您可以在Microsoft 的 Connect 网站上查看此未解决的问题。
I'll just quote them for the sake of the answer:
为了答案,我将引用它们:
Unfortunately in this release we had to cut the intellisense support for C++/CLI due to time constraints. If you want to get some intellisense like quick info and memberlist on the native classes you can get it by choosing no /clr support in the project properties.
不幸的是,在此版本中,由于时间限制,我们不得不削减对 C++/CLI 的智能感知支持。如果您想获得一些智能感知,例如本机类的快速信息和成员列表,您可以通过在项目属性中选择 no /clr support 来获得它。
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.
关于恢复智能感知,您现在最好的机会是使用第三方工具,例如 VA Assist。我已经在 Visual Studio 2008 中尝试过它,它的 IntelliSense 比默认的要好得多。
It is available again in Visual Studio 2012.
它在Visual Studio 2012 中再次可用。
回答by Ehtesham
If you want to get IntelliSense back, install Visual Assist Xfrom Whole Tomato Software. Here you can get a 30-days trial to check the intellisense.
如果您想恢复 IntelliSense,请从 Whole Tomato Software安装Visual Assist X。在这里,您可以获得 30 天的试用版来检查智能感知。
回答by Sam Skuce
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.
根据Visual C++ 团队博客,C++/CLI Intellisense 将在 Visual Studio 的下一个版本中,但不在 VS2010 的服务包中。那篇博文还详细说明出了什么问题并导致了这种悲伤的状态。
回答by cro
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.
我不知道您是否可以使用此设置,但它对我有用。我只检查使用它的 cpp 文件的公共语言运行时支持。我不会为整个项目检查它,并且我对所有不使用 CLI 的文件都有智能感知。
回答by Gholamalih
Yes! you can enable the IntelliSence, but in a tricky way. Follow these instructions:
是的!您可以启用 IntelliSence,但方法很复杂。请按照以下说明操作:
- Go to your project properties. (Right click on your project name in Project Explorer, and select Properties. or simply Alt+ Enter)
- From Configuration Properties, select General
- In the right-hand section, find "Common Language Runtime Support" and change it to "No Common Language Runtime Support".
- Click the OK Button.
- 转到您的项目属性。(在 Project Explorer 中右键单击您的项目名称,然后选择 Properties。或简单地Alt+ Enter)
- 从配置属性中,选择常规
- 在右侧部分,找到“Common Language Runtime Support”并将其更改为“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)
现在 IntelliSence 正在工作。但问题是编译代码时出错!(错误是:错误 LNK1123:转换为 COFF 时失败:文件无效或损坏)
You can simply go back to Project Properties an change Common Language Runtime Support to "Common Language Runtime Support, Old Syntax (/clr:oldSyntax)".
您可以简单地返回到项目属性,将公共语言运行时支持更改为“公共语言运行时支持,旧语法 (/clr:oldSyntax)”。
Good luck.
祝你好运。
回答by Palash Bansal
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 Supportand set it to No Common Language Runtime Support.
This will work fine just after hitting Applybutton.
此解决方案仅适用于您不想要Common Language Runtime
它在VS2010 中对我有用
转到Project Properties > Configuration Properties > General > Common Language Runtime Support并将其设置为No Common Language Runtime Support。这将在点击应用按钮后正常工作。
回答by jester
As mentioned you could install some paid software such as "Visual Assist X from Whole Tomato Software".
如前所述,您可以安装一些付费软件,例如“来自 Whole Tomato Software 的 Visual Assist X”。
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.
您可以使用包含 Intellisense* 的开源工具,其中一种工具是 Qt Creator 3.3.1(开源)。您有两种选择,要么使用 Qt 设置整个项目以使用 VS2010 编译器进行编译,要么使用 Qt 链接到您的源文件并使用 VS2010 进行编译。您在 Qt 中编写代码,保存,将窗口翻转到 vs2010 并编译和调试。
When changes are saved in Qt, vs2010 will automatically reload the source file in the project and you can compile.
在Qt中保存更改后,vs2010会自动重新加载项目中的源文件,您就可以编译了。

