mshtml InvalidCastException issue  [ 809 views ]

Goal: to solve mshtml issue

When I use a webBrowser control in my .net application and I try to work with the control, sometimes I’ve got the following error.

InvalidCastException

System.InvalidCastException: Unable to cast COM object of type ‘System.__ComObject’ to mshtml. …

May be the message will be different but the reason is the same. The Microsoft.mshtml.dll is not registered!

Regasm Microsoft.mshtml.dll
#sidebar a { color:#fff; } #sidebar ul ul li { color: #DEF585; } #sidebar h2 { color: #fff; } #sidebar ul p, #sidebar ul select { color: #BEDDBE; } #backfly { background: url(images/golfBallWallPaper.jpg) left bottom fixed repeat-x #65a51d; }