Cannot find method although defined and used?

I'm currently creating a WPF project and have this static class:
namespace KupoFinder.AppConfigHandler;

public static class AppConfigHandler
{
private const string ConfigFileName = "KupoFinder.settings.json";

public static void CheckConfigFile(){}

// ...
}
namespace KupoFinder.AppConfigHandler;

public static class AppConfigHandler
{
private const string ConfigFileName = "KupoFinder.settings.json";

public static void CheckConfigFile(){}

// ...
}
And I use it in my ViewModel like this:
using CommunityToolkit.Mvvm.ComponentModel;
using KupoFinder.AppConfigHandler;

namespace KupoFinder.MVVM;

public partial class MainWindowVM : ObservableObject
{
public MainWindowVM()
{
AppConfigHandler.CheckConfigFile();
}
}
using CommunityToolkit.Mvvm.ComponentModel;
using KupoFinder.AppConfigHandler;

namespace KupoFinder.MVVM;

public partial class MainWindowVM : ObservableObject
{
public MainWindowVM()
{
AppConfigHandler.CheckConfigFile();
}
}
But I get the error: Cannot resolve symbol 'CheckConfigFile' It should find it tho cuz my VM has a dependency on it. Does anyone see the error?
2 Replies
Omnissiah
Omnissiah6mo ago
i think it's because you have class name == namespace (AppConfigHandler)
Ellen Joe.♡
Ellen Joe.♡OP6mo ago
I changed the namespace name, now it works. Ty a lot!!
Want results from more Discord servers?
Add your server