dotnet / maui

.NET MAUI is the .NET Multi-platform App UI, a framework for building native device applications spanning mobile, tablet, and desktop.
https://dot.net/maui
MIT License
22.07k stars 1.73k forks source link

Creating .NET MAUI Project sometimes causes transient errors in MainPage.xaml.cs #25206

Open samhouts opened 1 week ago

samhouts commented 1 week ago
Affected Branch: main
Affected Build: 17.12 Preview 2 (35212.216 main)

Steps to reproduce:

1. Create new .NET MAUI Project
2. Wait for project to finish loading.
3. Open MainPage.xaml.cs

Expected: No Errors
Actual: (Sometimes)

[Visual Studio Host (31088):DocumentWindowTestExtension] Showing window 'MainPage.xaml.cs' without activating the window.14:08:34
[Visual Studio Host (31088):ErrorListService] Expect empty but still show items within timeout 15 seconds.14:08:52
[Visual Studio Host (31088):ErrorListService] + Top 10 Error List items:14:08:52
 →  [Visual Studio Host (31088):ErrorListService] Error list item: The type or namespace name 'ContentPage' could not be found (are you missing a using directive or an assembly reference?); in file "MainPage.xaml.cs"14:08:52
 →  [Visual Studio Host (31088):ErrorListService] Error list item: The name 'InitializeComponent' does not exist in the current context; in file "MainPage.xaml.cs"14:08:52
 →  [Visual Studio Host (31088):ErrorListService] Error list item: The name 'CounterBtn' does not exist in the current context; in file "MainPage.xaml.cs"14:08:52
 →  [Visual Studio Host (31088):ErrorListService] Error list item: The name 'CounterBtn' does not exist in the current context; in file "MainPage.xaml.cs"14:08:52
 →  [Visual Studio Host (31088):ErrorListService] Error list item: The name 'SemanticScreenReader' does not exist in the current context; in file "MainPage.xaml.cs"14:08:52
 →  [Visual Studio Host (31088):ErrorListService] Error list item: The name 'CounterBtn' does not exist in the current context; in file "MainPage.xaml.cs"14:08:52
 →  [Visual Studio Host (31088):ToolWindowTestExtension] Showing window 'Error List' without activating the window.



View on AzDO

ninachen03 commented 1 week ago

We also meet this issue, we found this related to https://github.com/dotnet/maui/issues/16501.Maybe they are duplicate When reproducing this https://github.com/dotnet/maui/issues/16501, opening the .cs file, the following error will appear.

StephaneDelcroix commented 4 days ago

@jonathanpeppers does this ring a bell ?

jonathanpeppers commented 4 days ago

It looks to me like a design-time build ran before NuGet restore was complete or the design-time build had an error.

Do we have some .binlogs from Project System Tools? https://aka.ms/binlog