Mr-Markus / ZigbeeNet

A .NET Standard library for working with ZigBee
Eclipse Public License 1.0
131 stars 47 forks source link

Make the libraries target multi frameworks: netstandard2.0 and net461 #69

Closed spudwebb closed 4 years ago

spudwebb commented 4 years ago

My project needs to target Net Framework 4.6.2, if I reference the ZigBeeNet library as is, it adds a gazillion shim dlls to my output directory. To avoid this problem I made the 4 libraries multi target projects and I added the 4.6.1 which I think is the minimum version we can target because it is the minimum for System.IO.Ports

Also I had some problem in Visual studio with the ZigBeeNet.Hardware.Digi.XBee library. Removing and re-adding this project to the solution fixed those problems. I think the project type GUID in the .sln file was wrong.

Mr-Markus commented 4 years ago

Because this library should run on multi plattforms and in a modern environment we won't target .Net fullframework, but netstandard and .Net Core only.

Just take a look at the build result. Here it can not compile on linux.

But you can do this by your own with own .csproj files, that includes all files and targets net461. My suggestion would be to create a .csproj per project and collect them in an own subfolder and exclude this subfolder in your .gitignore. This gives you the possibility to use it as you need it without getting in conflict with our roadmap

If you need further information just comment below

spudwebb commented 4 years ago

Making it a multi target library does not make it not multi platforms. It stills target netstandard2.0 It's more a convenience for developers like me who are stuck with full framework projects. A lot of open source libraries use multi targeting, Serilog and Newtonsoft.Json that you use in this project are two of them.

I'm sure there is a way to make the linux build ignore the 4.6.1 target

Anyway, I can live without it, it would just make my life easier to use and contribute to this library.

Mr-Markus commented 4 years ago

Targeting old or full framework restricts us in many points. If we will use classes or namespaces which are only availible in newer technologies we need to care about them with special code. (preprocessor directives etc)

In my opinion it could not be our target as a developer to create something new when we always have to support old plattforms if there is something newer when we start. You will get more and more in trouble if you do not update youre software. Maybe it will work a long time, but it causes to spend much more time in development. And even not after 2 or 3 year, but after 5 or 10 years you will be dead. You should think aabout this.

So we are thinking in the future and not in the past.

I hope you will find a solution that works for you