I am trying to use a using
statement in Cake so that I can use the Regex
class.
The line where I am trying to use this:
var matchesFromBranch = Regex.Matches(gitBranch, jiraPattern, RegexOptions.IgnoreCase).Select(m => m.Value).Distinct();
This gave me the following error:
.../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
So I added using System.Text.RegularExpressions;
to the top of my file. Now I get the following error:
.../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'