C# browser automation without external executables

I’m trying to automate web browsing in C# but I’m stuck with a big problem. My project has security rules that won’t let me run any .exe files from my code. This is causing issues because most headless browsers like Chrome and others need their own executable files to work with Selenium.

I’ve been searching for ways around this but haven’t found much. I thought about loading the browser executable into memory somehow but that seems really complicated. I also considered if there’s a way to convert the .exe into a DLL or library that I could reference directly.

Does anyone know of a headless browser solution that works purely as a .NET library without needing external processes? Or maybe there’s a different approach to web automation that doesn’t involve traditional headless browsers?

Any suggestions would be really helpful since I’m pretty much stuck right now.

WebView2 is perfect for this. It’s Microsoft’s embedded browser control that runs on Edge WebView2 runtime - usually already installed on Windows. Just grab the Microsoft.Web.WebView2 NuGet package and you get full browser automation without spawning separate processes. The control runs in-process with your app and gives you a COM interface for clicking elements, filling forms, and extracting data. I’ve used it in corporate environments with tight security where external executables were blocked - worked great. Only requirement is WebView2 runtime on the target machine, but Windows Update handles that automatically now.

i had that issue too, but tried using HtmlAgilityPack with HttpClient. it’s not too fancy like Selenium but for basic stuff it’s great and has no .exe files involved. might be worth a shot for what you need!