Jonathan Beerhalter
Jonathan Beerhalter

Reputation: 7407

How do I use regular expressions with Nant 0.91 calling a C#

In Nant 0.85 you could call C# scripts and it would import the System.Text.RegularExpressions namespace. Now in 0.91 that is no longer the case, and I can't seem to to import System.Text.RegularExpressions properly. I've tried adding the following

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

And I see System.Text.RegularExpressions get added to a using statement, but I keep getting the error:

The type or namespace name 'RegularExpressions' does not exist in the namespace 'System.Text' (are you missing an assembly reference?)

Upvotes: 3

Views: 520

Answers (1)

NickD
NickD

Reputation: 2646

You need to add a reference to System.dll:

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

Upvotes: 5

Related Questions