4

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'

Community
  • 1
  • 1
Sam Debruyn
  • 928
  • 1
  • 8
  • 22

1 Answers1

0

Check in the tools/Cake folder and remove any references to the System.Text.RegularExpressions assembly and re run your bootstrapping script.

Even just delete the tools folder and re run the bootstrapper.

J.P.
  • 9
  • 3