Avalonia Can't find Package
See original GitHub issueI am trying to implement LiveCharts2 into my project, but keep getting compile errors form the XAML file saying “Unable to resolve type PieChart from namespace using:LiveChartsCore.SkiaSharpView.Avalonia”. The program will run, but it doesn’t display the graphs. I installed LiveCharts from the Package manager console using this line: “Install-Package LiveChartsCore.SkiaSharpView.Avalonia -Version 2.0.0-beta.300”
I set up my view like this:
<UserControl xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d"
xmlns:lv="clr-namespace:LiveChartsCore;assembly=LiveChartsCore"
xmlns:lvc="using:LiveChartsCore.SkiaSharpView.Avalonia"
x:Class="PowderInventory.InventoryManagement.UI.Views.OperatorView">
<StackPanel HorizontalAlignment="Center" VerticalAlignment="Center">
<TextBlock Text="Hi, this is the operator view" />
<TextBlock Text="{Binding UrlPathSegment}" />
<lvc:PieChart Series="{Binding Series}" LegendPosition="Right"/>
</StackPanel>
</UserControl>
and my ViewModel uses the Series data from the sample
public IEnumerable<ISeries> Series { get; set; } = new ISeries[]
{
new PieSeries<double> { Values = new double[] { 2 }, Name = "Slice 1" },
new PieSeries<double> { Values = new double[] { 4 }, Name = "Slice 2" },
new PieSeries<double> { Values = new double[] { 1 }, Name = "Slice 3" },
new PieSeries<double> { Values = new double[] { 4 }, Name = "Slice 4" },
new PieSeries<double> { Values = new double[] { 3 }, Name = "Slice 5" }
};
Issue Analytics
- State:
- Created a year ago
- Comments:7 (1 by maintainers)
Top Results From Across the Web
Avalonia project is giving me a hell of errors!!! : r/dotnet
Unable to find package Avalonia.Desktop. No packages exist with this id in source(s): C:\Program Files\dotnet\library-packs.
Read more >how to resolve "Unable to find package" nuget error
Go to Package Manager Settings (Tools > Nuget Package Manager > Package ... It couldn't find the packages as it was looking for...
Read more >Avalonia 11.0.4
Avalonia is a cross-platform UI framework for .NET providing a flexible styling system and supporting a wide range of Operating Systems such as...
Read more >Upgrading from 0.10
Update the Avalonia packages to 11.x; Themes are no longer included in the Avalonia.Desktop package, so you will need to add a package...
Read more >Avalonia
ReactiveUI Docs. For WhenActivated to work, you need to use custom base classes from Avalonia.ReactiveUI package, such as ReactiveWindow<TViewModel> ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Hi. I also was having this issue. CartesianChart was working, but it wasn’t showing on designer preview. I added this to Program.cs in BuildAvaloniaApp method.
GC.KeepAlive(typeof(LiveChartsCore.SkiaSharpView.Avalonia.CartesianChart).Assembly);
Having the same issue