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

时间:2022-01-01 17:02:19

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.

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

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.

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


Edit: 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.

编辑:我知道关于.rules文件的所有信息。我所说的是Visual Studio 2008中的GUI对话框,它允许您创建和编辑这些.rules文件。这是我提到的对话框,当您添加具有未知扩展名的文件时会弹出该对话框。

1 个解决方案

#1


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. Right-click your project
  2. 右键单击您的项目

  3. Select "Custom Build Rules..."
  4. 选择“自定义构建规则...”

  5. Click the button "New Rule File..."
  6. 单击“新规则文件...”按钮

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)

如果您正在询问如何获取“未找到匹配的自定义构建规则”消息框,我不确定您是如何做到这一点的。 (如果那是你想要做的,你可能想在你的问题中澄清一下)

#1


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. Right-click your project
  2. 右键单击您的项目

  3. Select "Custom Build Rules..."
  4. 选择“自定义构建规则...”

  5. Click the button "New Rule File..."
  6. 单击“新规则文件...”按钮

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)

如果您正在询问如何获取“未找到匹配的自定义构建规则”消息框,我不确定您是如何做到这一点的。 (如果那是你想要做的,你可能想在你的问题中澄清一下)