-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] Error referencing InitializeComponent in public App() constructor, but Build succeeded. #1018
Comments
Hi @AleksandarDevic. In the provided screenshot, I don't see the solution explorer at the left. I can only see your MAUI project folder opened as a workspace. |
The |
I am experiencing the same event. windows 10, dotnet 8.0.204. |
Hi, @mauroa , any info, because the same thing on the latest .Net9? |
It also looks like this was an ongoing issue with the previous OmniSharp C# extension as well. |
Pretty straightforward to repro with Works fine with C# extension standalone. @tmeschter / @lifengl - IIRC what fixed this for the C# ext standalone was ensuring the |
I still have the same problems. Have you already found a solution? |
The same to you ┭┮﹏┭┮ |
is there any info about this? this problem is very annoying and i would like to use Omnisharp instead of the C# extension |
Writing in WPF on VSCode has extra errors with methods like "InitializeComponent" being marked as not existing. Would love to see a fix to this. |
Extensions->C# Dev Kit->Disable->Restart Extensions->Enable |
I am also getting the same error with .net 9, I use the community tool kit |
@lifengl Looks like WPF only hooks up Markup compilation if Opened dotnet/wpf#10489 |
Describe the Issue
When I create a simple MAUI project, in file MauiApp1\Platforms\Windows\App.xaml.cs
for method InitializeComponent I get a compiler error: 'App' does not contain a definition for 'InitializeComponent' and no accessible extension method 'InitializeComponent' accepting a first argument of type 'App' could be found (are you missing a using directive or an assembly reference?)CS1061.
But when I do dotnet build I get info Build Succeeded!
Steps To Reproduce
I created a simple MAUI project.
In file MauiApp1\Platforms\Windows\App.xaml.cs, for method InitializeComponent I get compiler error:
'App' does not contain a definition for 'InitializeComponent' and no accessible extension method 'InitializeComponent' accepting a first argument of type 'App' could be found (are you missing a using directive or an assembly reference?)CS1061.
But when I do dotnet build I get info Build Succeeded!
Expected Behavior
The compiler should recognize the method InitializeComponent from MauiWinUIApplication class.
Environment Information
| VS Bug 2032244
The text was updated successfully, but these errors were encountered: