Link to home
Start Free TrialLog in
Avatar of JPERKS1985
JPERKS1985

asked on

Upgrading code from Vb.NET 2003 to 2008 , 'HTMLElementCollection' is ambiguous in the namespace 'mshtml'.

I'm upgrading a very large app to vb.net 2008 from 2003 and I'm running into a lot of issues. I get this error "'HTMLElementCollection' is ambiguous in the namespace 'mshtml'."


My code:

Dim all As mshtml.IHTMLElementCollection = doc.getElementsByTagName(strTagName)
       

I've tried

Dim all As IHTMLElementCollection = doc.getElementsByTagName(strTagName)

I get the same error, these were not present when my code was compiled in 2003. Ive taken option strict off and avoided a lot of warnings but this one needs to be fixed.
       
Avatar of Bob Learned
Bob Learned
Flag of United States of America image

Make sure that your project only has one reference to Microsoft.mshtml.dll.

Are you parsing an HTML document from a WebBrowser?

Bob
Avatar of JPERKS1985
JPERKS1985

ASKER

Bob,

Thanks for the reply, I am parsing an HTML document from a web browser. When you say only one reference do you mean as far as imports or under references?

Option Strict Off


Imports System.IO
Imports System.Text
Imports System.Text.RegularExpressions
Imports System.Diagnostics
Imports System.Collections
Imports System.Threading
Imports System
Imports System.Xml
Imports System.Data
Imports System.Net
Imports System.Data.Common
Imports System.Data.OleDb
Imports System.ComponentModel
Imports DidChat
Imports mshtml
ASKER CERTIFIED SOLUTION
Avatar of Bob Learned
Bob Learned
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
That did it, thanks a ton for the help, it just got rid of 68 errors.