4
Vote

Using with .NET 4.0

description

I had a little bit of a difficulty using this within a .NET 4.0 solution. The compiler was complaining that there were duplicate implementations of the Func and Action delegates. In the end, I recompiled the solution (Clinq 2.2) and updated the Curry.tt file so that it didn't create as many of these delegates. I've attached my updated Curry.tt file.

file attachments

comments

rea5245 wrote Mar 11, 2011 at 5:32 PM

I see what happened. Curry.tt generates a bunch of System.Action<> and System.Func<> delegates with as few as 6 and as many as 20 arguments. In 3.5, .NET only included Action and Func with up to 5 arguments, so there was no name collision. In 4.0, .NET has added Action and Func delegates with up to 16 arguments, so the names Curry was generating collided.

Your modification removes Curry's Action and Func with 6 through 16 arguments but continues to generate them with 17, 18, 19, and 20 arguments.

Alas, I figured this all out on my own before coming across your post. Still, thank you!

wrote Mar 11, 2011 at 5:33 PM

wrote May 24, 2011 at 11:21 PM

wrote Feb 14, 2013 at 6:18 PM