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.

"Unable to find type" XAMLIL error message after deleting window from project

See original GitHub issue

This is a weird one. Versions: AvaloniaUI 0.10.0-pre6, Avalonia for Visual Studio 0.9.11.0

Steps:

  1. Create a new Avalonia Project (doesn’t matter if MVVM or not)
  2. Right click project -> add a new Window
  3. Don’t change the name of the window, will be named Window1.axaml
  4. Delete the Window by deleting the file Window1.axaml. This deletes both Window1.axaml and Window1.axaml.cs.

Try to compile the solution. An error message occurs: Unable to find type AvaloniaApplication1.Window1 Line 1, Position 2.

Grep the entire solution for Window1. No result.

Clean and rebuild the solution. The error persists.

Workaround I found:

  • Add a window with the same name again.
  • Rename the window. Only now will the window name show up in the csproj file
  • Delete the renamed window.

Now everything compiles fine again.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:6
  • Comments:9 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
MarchingCubecommented, Feb 22, 2021

This issue seems to appear fairly frequently lately and basically means that deleting XAML files without changing a line of code in a project will end up with this error.

Also in my case forcing 20+ devs to wipe their repo and rebuild for 10 minutes is not the greatest option. @kekekeks Are you going to have time to investigate this sometime?

Read more comments on GitHub >

github_iconTop Results From Across the Web

How do I fix "Unable to resolve type from namespace" error ...
I'm including this assembly in my client project and am having difficulty with name space resolution in a XAML definition. I' using the...
Read more >
Window Class - Typedescriptor
Window () Initializes a new instance of the Window class. ... "Unable to find type" XAMLIL error message after deleting window from project...
Read more >
Untitled
Altitude meussia, Non funziona audio pc windows 7, Contentobjects, ... Mcmillans flagstaff menu, Tobin rothlein, Fame soundtrack get on the floor, ...
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