microcharts-dotnet / Microcharts

Create cross-platform (Xamarin, Windows, ...) simple charts.
MIT License
2.03k stars 360 forks source link

[Bug]Getting Target error when Targeting Maui App to .net 7.0 #354

Open Rishi2611 opened 8 months ago

Rishi2611 commented 8 months ago

I am targeting maui app to .net 7.0 and getting error micro charts not supported on .net 7.0 Code:-

net7.0;net7.0-android;net7.0-ios;net7.0-maccatalyst

I am using this because I have added Unit Test Project respective to this project and have added reference of the the main project in unit test project, when i am running unit test app I am getting error micro charts not supported on .net 7.0

ISSPRO-Eng commented 7 months ago

Same here. Following this

albanfavresysmed commented 7 months ago

Same with .Net 8

BillyMartin1964 commented 1 month ago

Yeah, even when I exclusively say not for .net 8, I can't get it to recognize Microcharts:

 <ItemGroup Condition="'$(TargetFramework)' != 'net8.0'">
   <PackageReference Include="Microcharts.Maui" Version="1.0.0" />
 </ItemGroup>

Severity Code Description Project File Line Suppression State Priority Details Error (active) CS1061 'MauiAppBuilder' does not contain a definition for 'UseMicrocharts' and no accessible extension method 'UseMicrocharts' accepting a first argument of type 'MauiAppBuilder' could be found (are you missing a using directive or an assembly reference?) BeachBallApp (net8.0), BeachBallApp (net8.0-android34.0), BeachBallApp (net8.0-ios) D:\AppsMaui\BeachBallProperties\BeachBallApp\MauiProgram.cs 71 Normal

rajput400 commented 1 month ago

Facing the similar issue, it has something to do Microcharts.Maui is not compatible with .Net 7/8, but rather its compatible with .Net7/8 Android, Windows, IOS.
Also mentioned in the Compatibility Sections Built in views are provided for: UWP Xamarin.Forms, Xamarin.iOS and Xamarin.Android, Xamarin.macOS .NET MAUI (Windows, Android, iOS, and macOS) WinUI (Windows App SDK) And any other .NET Standard 2.0 SkiaSharp supported platform is also compatible (see one of the included ChartView implementations for more details). Will have to see if there is way-out to fix it.

follesoe commented 1 month ago

Are you using it off NuGet or building from source? I see that the version published on NuGet in Aug 2023, is only compatible with net6.0-ios and net6.0-android (and hence, iOS and Android versions of .NET 7.0 and 8.0).

The repo contains newer code where net7.0;net7.0-ios;net7.0-android are the target frameworks, but this code is not published to NuGet.