Skip to content

Running into an Avalonia.Markup.Xaml.XamlLoadException #58

Closed

Description

@jorgedevs

I updated my Avalonia project to 11.0.4, and trying to add oxyplot to my app. I add the NuGet package, add the Style in App.axaml,

<Application 
    xmlns="/avaloniaui"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:AvaloniaGreenhouse"
    x:Class="AvaloniaGreenhouse.App">

    <Application.Styles>
        <SimpleTheme/>
        <StyleInclude Source="avares://OxyPlot.Avalonia/Themes/Default.axaml"/>
    </Application.Styles>
</Application>

Running the app to make sure it builds and runs, I get the following exception:

Avalonia.Markup.Xaml.XamlLoadException HResult=0x80131500 Message=No precompiled XAML found for avares://OxyPlot.Avalonia/Themes/Default.axaml (baseUri: avares://AvaloniaGreenhouse/App.axaml), make sure to specify x:Class and include your XAML file as AvaloniaResource Source=Avalonia.Markup.Xaml StackTrace: at Avalonia.Markup.Xaml.AvaloniaXamlLoader.Load(IServiceProvider sp, Uri uri, Uri baseUri) at Avalonia.Markup.Xaml.Styling.StyleInclude.get_Loaded() at Avalonia.Markup.Xaml.Styling.StyleInclude.Avalonia.Controls.IResourceProvider.AddOwner(IResourceHost owner) at Avalonia.Styling.Styles.InternalAdd(IList items, IResourceHost owner) at Avalonia.Styling.Styles.OnCollectionChanged(Object sender, NotifyCollectionChangedEventArgs e) at Avalonia.Collections.AvaloniaList1.NotifyAdd(T item, Int32 index)
at Avalonia.Collections.AvaloniaList1.Add(T item) at Avalonia.Styling.Styles.Add(IStyle item) at AvaloniaGreenhouse.App.!XamlIlPopulate(IServiceProvider , App ) in C:\Projects\Meadow.Desktop.Samples\Source\Windows\AvaloniaGreenhouse\App.axaml:line 9 at AvaloniaGreenhouse.App.!XamlIlPopulateTrampoline(App ) at AvaloniaGreenhouse.App.Initialize() in C:\Projects\Meadow.Desktop.Samples\Source\Windows\AvaloniaGreenhouse\App.axaml.cs:line 14 at Avalonia.AppBuilder.SetupUnsafe() at Avalonia.AppBuilder.Setup() at Avalonia.AppBuilder.SetupWithLifetime(IApplicationLifetime lifetime) at Avalonia.ClassicDesktopStyleApplicationLifetimeExtensions.StartWithClassicDesktopLifetime(AppBuilder builder, String[] args, ShutdownMode shutdownMode) at AvaloniaGreenhouse.App.Main(String[] args) in C:\Projects\Meadow.Desktop.Samples\Source\Windows\AvaloniaGreenhouse\App.axaml.cs:line 37

I've compared what I have with your example projects and I have no idea how to solve that exception.

Activity

  1. kekekeks commented on Sep 9, 2023

    @kekekeks
    Contributor

    It seems that the version on nuget.org is still targeting 0.10.x. Consider using https://github.com/oxyplot/oxyplot-avalonia/ as a submodule for now

  2. jorgedevs commented on Sep 9, 2023

    @jorgedevs
    Author

    hm ok, I can downgrade and try the nuget version, I'll report back (and close issue if I get it working). Thanks for the quick reply,

  3. VisualMelon commented on Sep 9, 2023

    @VisualMelon
    Contributor

    There is a 2.1.0-Avalonia11 version on nuget... I'm not sure why it isn't listed on nuget this minute...

  4. VisualMelon commented on Sep 9, 2023

    @VisualMelon
    Contributor

    I will probably release a version 2.1.2 which is Av11 only, because I've not had any feedback suggesting I should do otherwise, but that won't be for a week or so.

  5. jorgedevs commented on Sep 9, 2023

    @jorgedevs
    Author

    Release as a beta, maybe? I'd be happy to give it a try. :)

  6. VisualMelon commented on Sep 10, 2023

    @VisualMelon
    Contributor

    Should just need <PackageReference Include="OxyPlot.Avalonia" Version="2.1.0-Avalonia11" /> in your csproj

    Sorry, you meant for 2.1.2: yes, nothing stopping me, but I don't like to rush nuget deployments because I have a history of getting them wrong.

  7. jorgedevs commented on Sep 11, 2023

    @jorgedevs
    Author

    Understood, i cant find this 2.1.0-Avalonia11 version.

    image

    Im gonna close this issue. I'll use the Avalonia version that's compatible with the oxyplot Nuget version, and figure out the API changes (if any).

    Thank you all for the assist.

  8. VisualMelon commented on Sep 11, 2023

    @VisualMelon
    Contributor

    I am very confused. Anyhow, I've pushed 2.1.0-Avalonia11 to nuget just now, so hopefully it will actually work now.

  9. jorgedevs commented on Sep 11, 2023

    @jorgedevs
    Author

    Sorry, thought you meant that the package was already out. Anyways, I have made progress with latest stable version, and I can see the plotting canvas on Windows (left), but running it on my Raspberry Pi (right), i dont see it. Do you guys support Linux, by any chance?

    image

  10. VisualMelon commented on Sep 11, 2023

    @VisualMelon
    Contributor

    Sorry, thought you meant that the package was already out.

    I did: it's I that was mistaken.... and now very very confused because it means I have no idea how my Linux box was using it.

    Do you guys support Linux, by any chance?

    I use OxyPlot.Avalonia 11 on Linux all the time (somehow); can't recall having tested 0.10 but I have no reason to believe it wouldn't work

  11. jorgedevs commented on Sep 11, 2023

    @jorgedevs
    Author

    Ok, then good timing releasing the avalonia 11 preview (Nuget). I'll update my Avalonia back to 11 and try again, hopefully it works.

    I'll keep you posted.

  12. VisualMelon commented on Sep 11, 2023

    @VisualMelon
    Contributor

    Sorry for all the confusion (my fault entirely)

  13. jorgedevs commented on Sep 11, 2023

    @jorgedevs
    Author

    oh all good, I appreciate your quick responses, I have a deadline for this to work so you're support is welcome so I can keep going.

  14. jorgedevs commented on Sep 11, 2023

    @jorgedevs
    Author

    Progress!

    PXL_20230911_191959305

    I was missing a few more setup things, fortunately was able to figure it out comparing with the samples (which now match the versions I have).

    Thanks again. I might open more Issues if I run into any more hiccups. :)

  15. VisualMelon commented on Sep 11, 2023

    @VisualMelon
    Contributor

    If you have vague/throw-away questions, feel free to ask in the gitter: https://app.gitter.im/#/room/#oxyplot_oxyplot:gitter.im

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions