question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Avalonia 11 Preview Not Usable (for me): InitializeComponent not exist in MainWindow.axaml.cs

See original GitHub issue

I created a new project with Avalonia Application template in Visual Studio. Build and Run, no problem. Then I update the Avalonia related packages to 11.0.0-preview2 by NuGet. Try to build the project, it failed. Not a single line code changed.

Error 1: CS0103 InitializeComponent not exist (in MainWindow.axaml.cs) 图片

Error 2: AXN0002 XamlX.XamlParseException: Unable to resolve type FluentTheme from namespace https://github.com/avaloniaui

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

4reactions
rabbitismcommented, Oct 11, 2022

for the first issue, if that method is not auto generated, you can add manually.

private void InitializeComponent()
        {
            AvaloniaXamlLoader.Load(this);
        }
0reactions
timuniecommented, Oct 11, 2022

It’s a preview and not yet production ready. So I think templates should only be updated after final release.

Read more comments on GitHub >

github_iconTop Results From Across the Web

wpf - The name 'InitializeComponent' does not exist in ...
Another solution to this problem is to simply change the property-> Build Action on the XAML from Embedded Resource to anything else, save,...
Read more >
Every InitializeComponent() reference in my project is ...
If you don't want to try that route, for every file, you're going to need to look at the x:class attribute and see...
Read more >
Multiplatform UI Coding with AvaloniaUI in Easy Samples. ...
Avalonia is a great new multiplatform UI package similar but in many respects better than WPF. This is an introductory tutorial article.
Read more >
ResourceDictionary and XAML resource references
However, controls, shapes, and other FrameworkElements are not shareable, so they can't be declared as reusable resources.
Read more >
Dependency Injection with Avalonia UI Apps
In this experimental post, we'll see how I added dependency injection into an ongoing Avalonia application and discuss the pros and cons of...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found