Solved

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

Posted on 2007-12-04
4
993 Views
Last Modified: 2013-11-26
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.
       
0
Comment
Question by:JPERKS1985
  • 2
  • 2
4 Comments
 
LVL 96

Expert Comment

by:Bob Learned
Comment Utility
Make sure that your project only has one reference to Microsoft.mshtml.dll.

Are you parsing an HTML document from a WebBrowser?

Bob
0
 
LVL 1

Author Comment

by:JPERKS1985
Comment Utility
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
 
LVL 96

Accepted Solution

by:
Bob Learned earned 500 total points
Comment Utility
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
 
LVL 1

Author Comment

by:JPERKS1985
Comment Utility
That did it, thanks a ton for the help, it just got rid of 68 errors.
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Flash (http://en.wikipedia.org/wiki/Adobe_Flash) has evolved over the years to where it has become a masterful tool for displaying content screen.  It has excellent layout placement, UI precision as well as rendering capabilities. This, along with t…
In my previous two articles we discussed Binary Serialization (http://www.experts-exchange.com/A_4362.html) and XML Serialization (http://www.experts-exchange.com/A_4425.html). In this article we will try to know more about SOAP (Simple Object Acces…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

728 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now