C
C#4w ago
Ilonic

✅ XAML Constructor Error e0434352

Using VS 2022, after some time constructing it just started to show me this problem. In the main window I have a user control usage. So the XAML constructor can load the UserControl itself, but doesn't show it in MainWindow. It works neither in Visual Studio 2022 or Blend for Visual Studio 2022 and shows the same error e0434352 Help me pleeease
8 Replies
leowest
leowest4w ago
$nocontext
leowest
leowest4w ago
there is no way to help you if u dont provide any code, xaml and xaml.cs so we can look at $paste
MODiX
MODiX4w ago
If your code is too long, you can post to https://paste.mod.gg/, save, and copy the link into chat for others to see your shared code!
Ilonic
IlonicOP4w ago
Wait a second Ссылка на объект не указывает на экземпляр объекта. в Atlantide.NVM.<SetText>d__12.MoveNext() в C:\Users\WhyToKnowMyName\source\repos\Atlantide\Atlantide\NVM.xaml.cs:строка 147 --- Конец трассировка стека из предыдущего расположения, где возникло исключение --- в System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() в System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs) в System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler) private async void SetText(string text) { if (Editor == null) { Debug.WriteLine("Editor is null!"); return; } await Editor.EnsureCoreWebView2Async(); // Line 147 await Editor.CoreWebView2.ExecuteScriptAsync("editor.setValue("" + System.Web.HttpUtility.JavaScriptStringEncode(text) + "")"); } It's using WebView2 Meanwhile when running the program everything works
leowest
leowest4w ago
👆
Ilonic
IlonicOP4w ago
Okay, so I found the issue, I have a user control that was supposed to do code only when the program works, but it did on design stage too, because of that I was given this error
leowest
leowest4w ago
and thats why providing what I requested is important, we can't know things we have no context of

Did you find this page helpful?