Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / Interop / November 2006

Tip: Looking for answers? Try searching our database.

Mshtml interop problem

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Vincent Finn - 07 Nov 2006 15:51 GMT
Hi,

Not sure if this is the right group for this but I think it could
loosely be described as an interop problem since it is the interop dll
I can't get to work.

Can anyone tell me how to install the Microsoft.mshtml.dll correctly?

I am running VS2005.
I have a C# project which uses mshtml and works perfectly on my
machine.

I have installed it and everything works except the mshtml calls.

I get the following error:

System.InvalidCastException: Unable to cast COM object of type
'System.__ComObject' to class type 'mshtml.HTMLAnchorElementClass'.
COM components that enter the CLR and do not support IProvideClassInfo
or that do not have any interop assembly registered will be wrapped in
the __ComObject type. Instances of this type cannot be cast to any
other class; however they can be cast to interfaces as long as the
underlying COM component supports QueryInterface calls for the IID of
the interface.

I am referencing and installing the version from of the interop dll
from "C:\Program Files\Microsoft.NET\Primary Interop Assemblies".

I have tried copying it into "\Windows\assembly" and it made no
difference.

I have tried creating my own version of the dll (both sign and
unsigned) and it made no difference.

I have found a lot of questions about this sort of mshtml problem on
the groups but no answer.

If I install Visual Studio it'll work so I assume Visual Studio knows
how to install it correctly and I hope that means it is documented
somewhere.

Any help appreciated because I am completely out of ideas.

    Thanks, Vin
jiangsheng[MVP] - 07 Nov 2006 17:18 GMT
I guess you can put mshtml in gac.

Signature

Regards
Sheng Jiang

Microsoft Most Valuable Professional in Visual C++
http://www.jiangsheng.net

> Hi,
>
[quoted text clipped - 40 lines]
>
> Thanks, Vin
Vincent Finn - 08 Nov 2006 17:47 GMT
>I guess you can put mshtml in gac.

Is that not the same as copying it into \Windows\Assembly?

gacutil.exe isn't installed on the machine by the .Net 2 installer.
Is there another way of adding it to the GAC?

    Vin
Vincent Finn - 13 Nov 2006 10:47 GMT
>>I guess you can put mshtml in gac.
>
>Is that not the same as copying it into \Windows\Assembly?
>
>gacutil.exe isn't installed on the machine by the .Net 2 installer.
>Is there another way of adding it to the GAC?

Did a little reading and found that RegASM.exe is the .Net 2 app for
registering in the GAC which is where I as going wrong.
And that solves my problem.

    Thanks, Vin

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.