c# - Cannot find Linq Extension Method in Cake script -
i'm trying use linq extension methods in cake script, , can't find extension methods.
here script:
#r system.linq task("default").does(() => { var test = new list<string>() {"a", "b", "c"}; test.orderbydesc(x => x); }); runtarget(target);
i have tried lot of different ways of referencing system.link
- such adding .dll
or wrapping on quotes. of them seem work. if make incorrect reference, such system.link
, error when installing addins when executing script "assembly not found".
here full output get:
ps c:\git\cakeeftest\caketest> ./build.ps1 --experimental preparing run build script... running build script... analyzing build script... processing build script... compiling build script... error: c:/git/cakeeftest/caketest/build.cake(6,7): error cs1061: 'list<string>' not contain definition 'orderbydesc' , no extension method 'orderbydesc' accepting first argument of type 'list<string>' found (are missing using directive or assembly reference?)
i same results if run without --experimental
.
according issues in cake repository, should work expected: https://github.com/cake-build/cake/issues/1331
the linq extension method called orderbydescending() https://msdn.microsoft.com/en-us/library/bb548916(v=vs.110).aspx
also #r used referencing assemblies. usings, use using keyword. sysyem.linq should namespace that's imported default.
Comments
Post a Comment