The name 'InitializeComponent' does not exist in the current context still is not fixed! #23805
Labels
area-xaml
XAML, CSS, Triggers, Behaviors
platform/windows 🪟
s/triaged
Issue has been reviewed
s/verified
Verified / Reproducible Issue ready for Engineering Triage
t/bug
Something isn't working
Description
This has been an issue since .NET 5. I just reviewed the issues history and have seen many reports and they have all been closed, but this issue is not fixed. I have been on the verge of dumping MAUI and turning to Avalon or Uno because of these weird types of issues being a continual source of frustration.
I have been working on my app since MAUI pre-release days. I have tried to contribute to the issues list in a constructive manner, but eventually the frustration simply exceeds my capacity to be patient. At that point I tend to get overly terse, which I know is not constructive, but it does get your attention...
I have seen where a simple change the
.csproj
file causes MAUI to just lose its mind. Suddenly none of the items in axaml code-behind
are bound to thexaml
itself. In the past, I have had to spend hours recreating the entire solution to get around this issue. Yesterday, I had been running my app in preparation of creating a beta release when all of the sudden nothing compiles. It ran one minute, then after I added some comments to the project file, everything came to a screeching halt. I have no idea how to reproduce this, but it has happened to me at least five times and I am just about to pull the plug.I have 10 pages, the shell, and the app files that have all become afflicted. I delete the files, add them back in and still no go. I have created new pages altogether and still no go. I delete the bin and obj folders, clean, you name it and the issue remains. There is something wrong with the way the project file is processed after being manually edited.
There are many reasons that require manually editing the project file. The
<EnablePreviewFeatures>
tag, for instance, needs to be added. I need to publish anupackaged
app and that requires edits to the project file. I see warnings which are harmless but I detest seeing them in the build logs so I add<NoWarn>
flags. I had been successfully building and running the app until I added the following 2 comments to the project file:The issues highlighted by these warnings will eventually be cleaned up, but I simply do not want to see this in my build logs.
And
In an attempt to clean this up without having to rebuild the whole solution (which is the only way I have been able to get around this very annoying issue), I deleted the
App.xaml/App.xaml.cs
files, re-add the item anew, with no edits whatsoever and get this:The old, red squiggly line of death... Very annoying. Very disappointing...
After the last edit, the app simply will not build. Every single .xaml/.xaml.cs become unbound and almost every single control added to the page becomes
does not exist in the current context
. On top of that, the code-generated items produced by the CommunityToolkit.xxx won't build. I do not know if that is related or what... It could be... The encoding of some of the files isLF
while others areMIXED
. I do not know if that is related or not, either.I just don't want to have to do this again and again.......... :-(
Steps to Reproduce
It is as simple as that. All the way back to pre-release days...
Link to public reproduction project repository
I have done this many times before and will not take the time to do it again...
Version with bug
net8.0-android;net8.0-ios;net8.0-maccatalyst
Is this a regression from previous behavior?
Yes, this used to work in .NET MAUI
Last version that worked well
Unknown/Other
Affected platforms
Windows
Affected platform versions
net8.0-windows10.0.19041.0
Did you find any workaround?
Yes... rebuild the whole $*&%@! app from scratch which takes hours of wasted, unproductive time.
Since it seems I cannot add a screenshot to the 'Relavent log output', here that is:
and so on, and so on...
Relevant log output
No response
The text was updated successfully, but these errors were encountered: