可能的副本:
Visual Studio保持建立所有东西

我有一个项目,其中包括一个idl文件,它生成包含在同一项目的另一个文件中的.c文件。

我构建这个项目,一切都很好,我试着运行这个项目,我被告知该项目已经过时了,我想建立它。如果我选择是以构建它,则会再次编译IDL。

是否有任何方法可以停止此操作而无需设置VS项目设置,从不提示我构建?

有帮助吗?

解决方案

Once you've built the .idl file once, open it's properties and enable "Exclude from Build".

If you update the file, you can build it manually by selecting the file in Solution Explorer and choosing "Compile" (the shortcut is Ctrl+F7 on my setup, but this may vary).

If you don't include the generated files in your version control system, a fresh checkout will also need to manually rebuild the .idl file. This case in particular can cause a lot of confusion - it may be worth including the generated files under version control.

Another option is to create a custom build tool (or pre-build event), which would compare the last modified date/time of the .idl file with the last modified date/time of the output files and then call MIDL if required. This is the behaviour that VS uses to determine whether or not to run CL, but it is not used for MIDL and, as far as I know, cannot be enabled in VC++ 2008 project files.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top