C
C#2y ago
int

✅ InitializeComponent not being found, but `dotnet run` works?

Do I need something for the .NET/Omnisharp/whatever to recognize WPF stuff?
7 Replies
TheRanger
TheRanger2y ago
can you show the class?
int
intOP2y ago
using System.Windows;

namespace McPlug;

public partial class MainWindow : Window
{
public MainWindow()
{
InitializeComponent();
}
}
using System.Windows;

namespace McPlug;

public partial class MainWindow : Window
{
public MainWindow()
{
InitializeComponent();
}
}
quite simple
TheRanger
TheRanger2y ago
are you on VS or VSCode?
int
intOP2y ago
vsc vs is heavy , on my pc
TheRanger
TheRanger2y ago
since you have the red Squiggly Line and the error message next to it, you probably already have Omnisharp
jcotton42
jcotton422y ago
I'm not sure if the C# ext for VSCode understands XAML codegen probably doesn't, so even though the WPF SDK emits that method at compile time, the IDE tooling doesn't know that
int
intOP2y ago
aaaaaaaaahhhhhh i'll have to use VS then update: moved to avalonia, no more error 🦅🦅🦅🦅

Did you find this page helpful?