Closed NickAcPT closed 4 years ago
I wouldn't know how to configure NuGet for both the framework and the core versions.
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.
@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.
Any update on this? Can you publish a package for .NET Standard or .NET core?
@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
I considered forking but I'd prefer if the original package updated of course.
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
@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 :
as for the script you can use dotnet pack command instead of old nuget
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.
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.
@bigworld12 please enlighten me on how you built and published your package, as dotnet pack
doesn't work for .NET 3.5
@Lachee first you have to remove the reference to the old .nuspec
file
.nuspec
file into the project properties and edit the versions<NuspecFile>DiscordRPC.nuspec</NuspecFile>
you can also delete the .nuspec
file
then dotnet pack
will work correctly
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.
I feel like there should be builds of the
dotnet-core
branch on NuGet and AppVeyor separate from the original ones.