Hi,
Is it possible to use extension methods in C# using .NET 2 ?
I'm using Visual Studio 2013.
Thanks
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Manoj BhoirRank #599 · 4K reputationPosted Jun 23, 2015, 10:56 PM EDT
Upendra Pratap ShahiRank #329 · 7.5K reputationPosted Jun 23, 2015, 11:11 PM EDT
Jaipal ReddyRank #588 · 4.1K reputationPosted Jun 23, 2015, 11:15 PM EDT
namespace System.Runtime.CompilerServices
{
[AttributeUsage(AttributeTargets.Assembly | AttributeTargets.Class |
AttributeTargets.Method)]
public sealed class ExtensionAttribute : Attribute { }
}
With this in place, extension methods will work in .NET 2.0 with C# 3.0.
Sujeet SumanRank #790 · 2.9K reputationPosted Jun 23, 2015, 11:47 PM EDT
Debendra DashRank #200 · 12K reputationPosted Jun 24, 2015, 7:11 AM EDT