"Unable to find type" XAMLIL error message after deleting window from project
See original GitHub issueThis is a weird one. Versions: AvaloniaUI 0.10.0-pre6, Avalonia for Visual Studio 0.9.11.0
Steps:
- Create a new Avalonia Project (doesn’t matter if MVVM or not)
- Right click project -> add a new Window
- Don’t change the name of the window, will be named Window1.axaml
- 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:
- Created 3 years ago
- Reactions:6
- Comments:9 (8 by maintainers)
Top 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 >
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
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?
MSBuild is doing the same for
Compile
items: https://github.com/dotnet/msbuild/blob/f0eebf2872d76ab0cd43fdc4153ba636232b222f/src/Tasks/Microsoft.Common.CurrentVersion.targets#L3529-L3548