如何在调用 C# 的 Nant 0.91 中使用正则表达式

本文关键字:正则表达式 Nant 调用 | 更新日期: 2023-09-27 18:36:32

在Nant 0.85中,你可以调用C#脚本,它会导入System.Text.RegularExpressions命名空间。现在在 0.91 中不再如此,我似乎无法正确导入System.Text.RegularExpressions。我尝试添加以下内容

<imports>
  <import namespace="System.Text.RegularExpressions" />
</imports>

我看到System.Text.RegularExpressions被添加到 using 语句中,但我不断收到错误:

类型或命名空间名称"正则表达式"在 命名空间"System.Text"(是否缺少程序集引用?

如何在调用 C# 的 Nant 0.91 中使用正则表达式

您需要添加对System.dll的引用:

<references>
  <include name="System.dll" />
</references>