jbowmanp1107 / ImageCropper.Maui

MIT License
43 stars 10 forks source link

Can't unit test my project because nuget not compatible with .net7.0 #17

Closed orwo1 closed 1 month ago

orwo1 commented 4 months ago

I have a unit test project, which references my maui project, that was migrated from Xamarin.Forms. Since the solution is still in 3 projects structure (shared, droid, ios), I can still reference just the shared project. I can't however compile the shared project, since it has the following target frameworks: .net7.0 (to support the unit test project) .net7.0-android .net7.0-ios

And I get the build error:

Package ImageCropper.Maui 1.0.3 is not compatible with net7.0 (.NETCoreApp,Version=v7.0). Package ImageCropper.Maui 1.0.3 supports:

  • net6.0-android31.0 (.NETCoreApp,Version=v6.0)
  • net6.0-ios16.1 (.NETCoreApp,Version=v6.0)

So beyond upgrading your targets I would also like to suggest adding the stand alone .net target framework to support unit test projects.

jbowmanp1107 commented 1 month ago

Package has been updated to .NET 8, in v1.1.0.2 please let me know if this addressed your issue.

orwo1 commented 1 month ago

Hi thanks for your efforts, we will test this. Question: We're still on .NET 7.0. do you think this solves for that as well?

jbowmanp1107 commented 1 month ago

Hi you are right, this wouldn't work for that, I have pushed out a new release that is compatible with .net7.0/android/ios and .net8.0/android/ios. V1.1.0.5

orwo1 commented 1 month ago

ok thanks, I'll try to use it and update here

fatscally commented 2 weeks ago

Hi, the Nuget package is working fine for me on Android (I've not tried ios yet) but I need to add a few improvements such as imageSavePath, output size and compression etc. I forked the code but I'm having no luck getting it to compile. I've tried a ton of variations on the .Net versions.

Many errors like this one: Project '..\TOCropView.Maui\TOCropView.Maui.csproj' targets 'net8.0-ios;net7.0-ios'. It cannot be referenced by a project that targets '.NETCoreApp,Version=v8.0'. ImageCropper.Maui C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Current\Bin\amd64\Microsoft.Common.CurrentVersion.targets

image

fatscally commented 2 weeks ago

All of my Dependencies have Alerts on them?!

image

jbowmanp1107 commented 2 weeks ago

ToCropView.Maui will never build since you are on Windows, I am wondering if this is the reason why it won't build?

Are you able to build the ImageCropperDemo project? This uses the NuGet packages for everything and not project references