I have a System.Activities.Statements.InvokeMethod
activity. I'm trying to activate it with
TargetType: (null)
TargetObject: licxFiles //an ICollection<string>
MethodName: StoreIfHasValue
The StoreIfHasValue
:
public static void StoreIfHasValue(this ICollection<string> collection, string value)
{
if (value.IsNullOrEmpty( )==false)
collection.Add(value);
}
The only param I'm passing from the workflow designer is :
Direction: In
Type: String
Value: LicxUtilities.CheckForLicx(projectPath,doc)
CheckForLicx
:
public static string CheckForLicx(string projPath, XDocument proj)
{
var ns=proj.Root.Name.Namespace;
var q = from refs in proj.Root.Elements(ns+"ItemGroup").Descendants(ns+"EmbeddedResource")
where refs.Attribute("Include").Value.EndsWith(".licx", StringComparison.CurrentCultureIgnoreCase)
select refs.Attribute("Include").Value;
var licx=q.FirstOrDefault( ); //assume there is only one .licx file reference in the project
if (licx.IsNullOrEmpty( ))
return null;
return System.IO.Path.Combine(projPath, licx);
}
Is a problem that I'm using a method call as a param? Or why does this give the error
'ICollection`1' does not have a public instance method named 'StoreIfHasValue' matching the parameter types, generic type arguments, and generic type constraints supplied to InvokeMethod 'Check for and store'.