1

I am creating a .net library in Visual Studio 2015 with the following aims:-

  1. Support for .net 2, 3.5, 4 and 4.5+
  2. PCL Support (.net 4.5+)
  3. No extra dependencies apart from Json.net

Ideally the .net 4.5+ version of the library would make use of async, and include methods that return Task etc

Now there seems to be many different ways of supporting what I want to do, especially with the Visual Studio 2015/project.json release but what is a good approach starting from scratch today?

My library is relatively simple, so as much as I want to re-use code I don't want to compromise the .net 4.5 version.

What would be a sensible project structure, that would mean I could take advantage of the latest .net framework, but still build in support for older frameworks.

Geoff Smith
  • 585
  • 1
  • 5
  • 14

1 Answers1

0

With Beta8 of the WebDev tooling you are able to also target net2, net35, net40, net45, ...

Your library differences you might use #ifdef flags in your code to hide certain methods in certain builds.

Thomas
  • 5,080
  • 27
  • 42