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.
       
LVL 1
JPERKS1985Asked:
Who is Participating?
 
Bob LearnedConnect With a Mentor Commented:
No, I mean under the References in the Solution Explorer.  If you don't see the References node, then select 'Show all files'.

Bob
0
 
Bob LearnedCommented:
Make sure that your project only has one reference to Microsoft.mshtml.dll.

Are you parsing an HTML document from a WebBrowser?

Bob
0
 
JPERKS1985Author Commented:
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
0
 
JPERKS1985Author Commented:
That did it, thanks a ton for the help, it just got rid of 68 errors.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.