AmpScm / SharpSvn

Subversion wrapped for .Net 4.0+ and .Net Core
Apache License 2.0
60 stars 19 forks source link

.NET Core/5+ support in the NuGet package #5

Closed magnusbakken closed 3 years ago

magnusbakken commented 3 years ago

Hello, thanks for keeping this project alive!

Is the NuGet package at https://www.nuget.org/packages/SharpSvn intended to support .NET Core and .NET 5? The description in the readme makes it sound like I should be able to use it with .NET 5 when running on Windows, but when I try to install it in a project with <TargetFramework>net50-windows</TargetFramework> I get this error:

Package 'SharpSvn 1.14001.15' was restored using '.NETFramework,Version=v4.6.1, .NETFramework,Version=v4.6.2, .NETFramework,Version=v4.7, .NETFramework,Version=v4.7.1, .NETFramework,Version=v4.7.2, .NETFramework,Version=v4.8' instead of the project target framework 'net5.0-windows7.0'. This package may not be fully compatible with your project.

Am I missing a different version uploaded elsewhere? Or is .NET 5 support not included here?

rhuijben commented 3 years ago

The code is tested as .Net Framework 4.x build against .Net 5 so things work on Windows with .Net 5, but compiling a .Net 5/.Net Core specific build is work in progress, as is ARM64 support on Windows.

For now please ignore the warning that it may not be fully compatible. If you have suggestions on how we should update the .nuspec to suppress this, please let us know.

magnusbakken commented 3 years ago

It actually gives me an error, not a warning, so I'm not able to add the package from the Visual Studio UI. I haven't tested what happens if I add it manually and restore.

I'm not very knowledgeable about NuGet packaging so I'm not sure how the file needs to be updated. I can look into it.

rhuijben commented 3 years ago

I'm surprised this is an actual error for you, as it wasn't for me. Are you sure you are building for an explicit CPU type? (Either x86 or x64)

For the ARM64 issue I'm working on enabling a proper NetCore native build in the nuget package, this should resolve these issues while also enabling new scenarios...

magnusbakken commented 3 years ago

Turns out it becomes an error simply because I have TreatWarningsAsErrors=true on in my project file. I didn't realize that that setting also affects NuGet errors. I could get around that by referencing SharpSvn in a thin wrapper project that doesn't treat warnings as errors.

rhuijben commented 3 years ago

The latest version of the NuGet package introduces core support and a reference only assembly, does this fix your warning/error?

magnusbakken commented 3 years ago

It does. 👍 I'll close this.