C# – How to use SHDocVw in C# form


I'm trying to write a program that checks if the address in a web browser isn't a 404
I searched in google how to do it and I found a tutorial.
In the tutorial there's a namespace called SHDocVw.
Visual C# tells me the namespace 'SHDocVw' could not be found.
What I need to do to fix this?

Best Solution

Totally agreed that you should not use SHDocVw to test if a url is returning a 404. You should use a web client. Do not use SHDocVw for that.

But, if like me, you're googling SHDocVw for other reasons like controlling the IE browser window from your app and come across this post...

To add SHDocVw:

In Visual Studio, go to add a reference and browse to




This will add a reference to Interop.SHDocVw to your project.