Severity Code Description Project File Line Suppression State Error CS1061 'string[]' does not contain a definition for 'Any' and no accessible extension method 'Any' accepting a first argument of type 'string[]' could be found (are you missing a using directive or an assembly reference?)

The Any method is available as an extension method in the System.Linq namespace. To resolve the error, make sure to include the following using directive at the top of your file:

using System.Linq;

By including this using directive, you'll be able to use the Any method with arrays.