Lachee / discord-rpc-csharp

C# custom implementation for Discord Rich Presence. Not deprecated and still available!
MIT License
573 stars 95 forks source link

No .NET Core version on NuGet #77

Closed NickAcPT closed 4 years ago

NickAcPT commented 4 years ago

I feel like there should be builds of the dotnet-core branch on NuGet and AppVeyor separate from the original ones.

Lachee commented 4 years ago

I wouldn't know how to configure NuGet for both the framework and the core versions.

NickAcPT commented 4 years ago

Well, I feel like you just need to create another package. It should be easy with Visual Studio because they have support for editing the config files inside it.

PJB3005 commented 4 years ago

@Lachee #73 did this by making the project target .NET Standard. I made the project file multi-target net35;netstandard2.0. The build system then builds versions of the assembly for both .NET Framework 3.5 and .NET Standard 2.0 (runs on Core 2.0 or greater), and then both are included into the nupkg automatically. Then whatever is restoring the NuGet packages picks the best match to use.

jgoyvaerts commented 4 years ago

Any update on this? Can you publish a package for .NET Standard or .NET core?

bigworld12 commented 4 years ago

@jgoyvaerts I uploaded a temporary package here (it lacks the correct information tho) https://www.nuget.org/packages/DiscordRichPresence.Core/1.0.121 @Lachee please upload a package that targets .net standard

jgoyvaerts commented 4 years ago

I considered forking but I'd prefer if the original package updated of course.

Lachee commented 4 years ago

I can add .NET Core 2 files to the nuget packet, for sure. However the library (and the by extension the solution file) must retain its compatibility for .NET Framework 3.5. Additionally, it needs to be able for a single use of the build script to generate both .NET Core 2 and .NET Framework 3.5 files so nuget can upload them at the end of the build.

Once that is figured out then I will push a .NET Core compatible to the nuget, but in the mean time: This library is already compatible with .NET Core and I personally had no issues running it using .NET Core 2

bigworld12 commented 4 years ago

@Lachee you can have projects multi target. net standard 2.0 and .net framework 3.5

the package I uploaded is literally just the fork from your dotnet core branch, but removed the nuspec file since project can contain its info

this is how multi targeting looks like in nuget : image

bigworld12 commented 4 years ago

as for the script you can use dotnet pack command instead of old nuget

jgoyvaerts commented 4 years ago

I'm aware the packet works with dotnet core already, but it generates a build warning which is rather annoying, and which is what i'm trying to get rid of.

Lachee commented 4 years ago

Alright, i will look into this over the weekend. If I can just use dotnet pack, then the build scripts can be simplified and that should fix any concerns I have with releasing a .NET Core package along side the .NET Framework package.

Lachee commented 4 years ago

@bigworld12 please enlighten me on how you built and published your package, as dotnet pack doesn't work for .NET 3.5

bigworld12 commented 4 years ago

@Lachee first you have to remove the reference to the old .nuspec file

  1. right click DiscordRPC.csproj > properties > package
  2. copy over all the properties from the old .nuspec file into the project properties and edit the versions
  3. now open the .csproj file as a text and remove this line <NuspecFile>DiscordRPC.nuspec</NuspecFile>

you can also delete the .nuspec file

then dotnet pack will work correctly

Lachee commented 4 years ago

Latest nuget package has both .Net FX 3.5 and .NET Core 2.0 packages. @bigworld12 ended up just modifying my MSBuild script so I can still use the nugspec.