Visual Studio自定义构建步骤规则?

Visual Studio自定义构建步骤规则?

问题描述:

使用Visual Studio 2008,当我向C ++项目中添加非.c/.cpp/.h/.rc或IDE无法识别的文件时,会弹出一个对话框,询问我是否要为此创建自定义生成步骤规则种文件.

Using Visual Studio 2008, When I add to a C++ project a file that is not .c/.cpp/.h/.rc or anything the IDE doesn't recognize a dialog pops up which asks me if I want to create a custom build step rule for this kind of files.

有人知道如何在不添加文件的情​​况下进入此对话框吗?我似乎无法在任何菜单中找到.

Does anybody know how to get to this dialog without adding a file? I can't seem to be able to find in any of the menus.

我完全了解.rules文件.我要说的是Visual Studio 2008中的一个GUI对话框,它允许您创建和编辑这些.rules文件.这是我提到的对话框,当您添加扩展名未知的文件时会弹出该对话框.

I know all about the .rules file. What I'm talking about is a GUI Dialog from within Visual Studio 2008 which allows you to create and edit these .rules files. This is the dialog I mentioned which pops up when you add a file with an unknown extension.

如果添加扩展名未知的项目,则会出现一个标题为找不到匹配的自定义构建规则"的消息框,询问您是否喜欢创建一个新的规则文件来定义一个自定义构建规则,以构建具有该扩展名的文件.如果单击是",则将显示新规则文件"对话框.

If you add an item with an unknown extension, you'll get a message box titled "Matching Custom Build Rule Not Found", which asks if you'd like to create a new rule file to define a custom build rule to build files with that extension. If you click "Yes", you'll get the "New Rule File" dialog.

如果您只想获得相同的新规则文件"对话框:

If you'd like to just get that same "New Rule File" dialog:

  1. 右键单击您的项目
  2. 选择自定义构建规则..."
  3. 单击按钮新规则文件..."

如果您询问如何获取找不到匹配的自定义构建规则"消息框,我不确定您将如何执行此操作. (如果您要这样做,则可能需要在问题中加以澄清)

If you're asking how to get the "Matching Custom Build Rule Not Found" message box itself, I'm not sure how you'd do that. (If that's what you're trying to do, you may want to clarify that in your question)