You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Does the file exist, or is it in another location?
Here is the code that expects to find the file:
public static string GetHostsPath()
{
var systemPath = Environment.GetEnvironmentVariable("SystemRoot");
var hostsPath = Path.Combine(systemPath, "system32\\drivers\\etc\\hosts");
if (!File.Exists(hostsPath))
throw new FileNotFoundException("Hosts file not found at expected location.");
return hostsPath;
}
If the file does not exist, then I suggest creating it. I don't know your platform, so I suppose you'll need to check that the OS uses the file at that location.
@fschwiet WOW64 redirection can lead a 32 bit application to report such exceptions on a Windows x64 machine. You should modify your library to better work that scenario,
I am facing this exception on some user side @fschwiet please help
The text was updated successfully, but these errors were encountered: