projectgoav/E.Deezer

Convert project to target .net standard

filipkristo opened this issue · 5 comments

Problem is when I using this lib in .NET core app I get build warning, and also I'm not sure it willl work on all platforms and OS.
So I thing the best way is to convert PCL project to .NET standard. In meantime, I forked repository and tried build with version 1.1 and everything is working fine.
image

.NET framewrok 4.5 also support .net standard 1.1
More details are here
https://docs.microsoft.com/en-us/dotnet/standard/net-standard

So, is it OK if you accept my changes and publish package to nuget?

Thank you!

Br,
Filip Kristo

.NET Standard has been something I want to do for a while, just never got around to it! Happy to look at your changes and get them merged

Great! It will be soon.
Also, there is some build errors on unit test. IDeezerClient is internal interfaces, so unit test cant see them.
Do you have any idea how to fix that?
If you want I can fix that or just ignore it?

image

You'll need to ensure that s NET Standard project doesn't automagically generate the AssemblyInfo. There's an xml element you add to the csproj for this which I can't remember off-hand.

If you can re-use the existing assemblyinfo.cs file then it should just work again. Otherwise you'll need to create a new one and add the [assembly: InternalsVisibleTo(<Assembly Name>)] attribute for this to work :)

Edit: I'm happy for you just to ignore it. The tests don't really cover much (which I'd like to change) and may come out in the wash with future plans.

Because in .NET standard there is no AssembleyInfo.cs InternalsVisibleTo(<Assembly Name>) attribute can add in any file... Here is a post about that...
http://anthonygiretti.com/2018/06/27/how-to-unit-test-internal-classes-in-net-core-applications/

Also, now there is no need for E.Deezer.nuspec, because it can be defined in project settings, and nuget can generate on build. The result is E.Deezer.3.X.X.nupkg in Release/Debug folder...
Here is a example

image

Also, because of ProjectReferences, it can automatically detect other nuget dependencies

Implemented in #66