I\'m building a DLL class library - I want to make it usable by as many people as possible. Which version of the .NET Framework and which C# version should I use? Is it po
I don't think anyone uses .Net 1.1 anymore. So unless you really want to use 3.5 features 2.0 should be fine. Also if you have control over who's going to actually use your library then it depends on them too. If they have the latest framework then you could use that.
It depends on what the dll is for. If it just has a generic C# logic that you would like to make available to others, then .net 2.0 is probably your best bet. However if it has anything to do with the newer features in .net like WPF, EF, WCF, silverlight, ect then it will need to be in the version of .net that supports that particular feature.
Personally, I would say write it in .net 3.5 only because making the jump from .net2.0 to .net3.5 is pretty painless because there is not many breaking changes unlike the jump from .net1.x to .net2.0. :)
This solution works quite well. I just set up two different projects each with a unique "Project Properties->Build->Conditional compilation Symbols" and used in the code like this:
#if NET_4
xmlReaderSettings.DtdProcessing = DtdProcessing.Ignore;
#endif
#if NET_3_5
xmlReaderSettings.ProhibitDtd = false;
#endif
I would target version 2.0 with the library containing the core functions and add an extra library targeting 3.5 to add some extension methods based on your core library.
From my point of view, if you want a wide range of users, you should do it with the early versions, 1.1 will be nice, because it will work on any machine has .Net what ever its version.
try this:
switch targetting mode to framework 2.0 (removing System.Core reference).
if it not compile, than try adding a reference to linqbridge.dll:
If not, then you should target 3.5 ;)