There are times when your .NET program needs to perform an operation that requires administrative rights (elevated privileges). An example could be modifying the hosts file (C:\Windows\System32\drivers\etc\hosts on Windows or /etc/hosts on Linux and macOS). Technically, it’s not possible to “elevate the current process”. In reality, the only thing we can do is to start a new process with administrative rights. In this article, we will explore how to do this with a console application - ...