gpt4 book ai didi

c# - 在 Cake 中使用语句

转载 作者:行者123 更新时间:2023-11-30 12:55:09 32 4
gpt4 key购买 nike

我正在尝试在 Cake 中使用 using 语句,以便我可以使用 Regex 类。

我尝试使用它的行:

var matchesFromBranch = Regex.Matches(gitBranch, jiraPattern, RegexOptions.IgnoreCase).Select(m => m.Value).Distinct();

这给了我以下错误:

.../build.cake(43,25): error CS0103: The name 'Regex' does not exist in the current context

.../build.cake(43,63): error CS0103: The name 'RegexOptions' does not exist in the current context

所以我在文件顶部添加了 using System.Text.RegularExpressions;。现在我收到以下错误:

.../build.cake(43,25): error CS0433: The type 'Regex' exists in both 'System.Text.RegularExpressions, Version=4.1.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' and 'System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'

.../build.cake(43,63): error CS0433: The type 'RegexOptions' exists in both 'System.Text.RegularExpressions, Version=4.1.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' and 'System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'

最佳答案

检查 tools/Cake 文件夹并删除对 System.Text.RegularExpressions 程序集的所有引用,然后重新运行引导脚本。

甚至只是删除工具文件夹并重新运行 Bootstrap 。

关于c# - 在 Cake 中使用语句,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51270465/

32 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com