Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. How to Register mshtml dll in to GAC ? Urgent.

How to Register mshtml dll in to GAC ? Urgent.

Scheduled Pinned Locked Moved C#
dotnetcomhelptutorialquestion
5 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    J Offline
    Jacobb Michael
    wrote on last edited by
    #1

    Dear All, I am using the bellow lines

    mshtml.HTMLHeadElementClass elDynHead = null;
    foreach (IHTMLElement elcol in (IHTMLElementCollection)document.getElementsByTagName("HEAD"))
    {
    if (elcol.ToString() == "mshtml.HTMLHeadElementClass")
    {
    elDynHead = (mshtml.HTMLHeadElementClass)elcol;
    }
    }

    it works in Develpement system, but not in the client system it throws the following error

    Error :: System.InvalidCastException: Unable to cast COM object of type 'System.__ComObject' to class type 'mshtml.HTMLHeadElementClass'. 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.
    at PAW_URL.clsURLMON.browser_DocumentComplete(Object pDisp, Object& URL)

    so i think i have to Register mshtml in GAC. But i dont know how to do it. can some one help me how to Register the mshtml.dll in to GAC.(urgent please) thanks in Adavnce

    C J 2 Replies Last reply
    0
    • J Jacobb Michael

      Dear All, I am using the bellow lines

      mshtml.HTMLHeadElementClass elDynHead = null;
      foreach (IHTMLElement elcol in (IHTMLElementCollection)document.getElementsByTagName("HEAD"))
      {
      if (elcol.ToString() == "mshtml.HTMLHeadElementClass")
      {
      elDynHead = (mshtml.HTMLHeadElementClass)elcol;
      }
      }

      it works in Develpement system, but not in the client system it throws the following error

      Error :: System.InvalidCastException: Unable to cast COM object of type 'System.__ComObject' to class type 'mshtml.HTMLHeadElementClass'. 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.
      at PAW_URL.clsURLMON.browser_DocumentComplete(Object pDisp, Object& URL)

      so i think i have to Register mshtml in GAC. But i dont know how to do it. can some one help me how to Register the mshtml.dll in to GAC.(urgent please) thanks in Adavnce

      C Offline
      C Offline
      Christian Graus
      wrote on last edited by
      #2

      jasome wrote:

      so i think i have to Register mshtml in GAC.

      You are utterly wrong. The mshtml DLL is obviously not present on the target system. It's a COM dll, that's what the error message says. Therefore, it's almost certainly not .NET, and cannot be put in the GAC. If you were to google the error message, you'd get a ton of previous questions like this[^] one.

      Christian Graus Driven to the arms of OSX by Vista. Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.

      J 1 Reply Last reply
      0
      • C Christian Graus

        jasome wrote:

        so i think i have to Register mshtml in GAC.

        You are utterly wrong. The mshtml DLL is obviously not present on the target system. It's a COM dll, that's what the error message says. Therefore, it's almost certainly not .NET, and cannot be put in the GAC. If you were to google the error message, you'd get a ton of previous questions like this[^] one.

        Christian Graus Driven to the arms of OSX by Vista. Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.

        J Offline
        J Offline
        Jacobb Michael
        wrote on last edited by
        #3

        Hi Thanks, Do you have any idea ? How to overcome this problem. if it is please do guide me thanks

        1 Reply Last reply
        0
        • J Jacobb Michael

          Dear All, I am using the bellow lines

          mshtml.HTMLHeadElementClass elDynHead = null;
          foreach (IHTMLElement elcol in (IHTMLElementCollection)document.getElementsByTagName("HEAD"))
          {
          if (elcol.ToString() == "mshtml.HTMLHeadElementClass")
          {
          elDynHead = (mshtml.HTMLHeadElementClass)elcol;
          }
          }

          it works in Develpement system, but not in the client system it throws the following error

          Error :: System.InvalidCastException: Unable to cast COM object of type 'System.__ComObject' to class type 'mshtml.HTMLHeadElementClass'. 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.
          at PAW_URL.clsURLMON.browser_DocumentComplete(Object pDisp, Object& URL)

          so i think i have to Register mshtml in GAC. But i dont know how to do it. can some one help me how to Register the mshtml.dll in to GAC.(urgent please) thanks in Adavnce

          J Offline
          J Offline
          Jacobb Michael
          wrote on last edited by
          #4

          Hi all, any way i'v found the solution. we need to run a exe called "vs_piaredist.exe" thanks to all.

          C 1 Reply Last reply
          0
          • J Jacobb Michael

            Hi all, any way i'v found the solution. we need to run a exe called "vs_piaredist.exe" thanks to all.

            C Offline
            C Offline
            Christian Graus
            wrote on last edited by
            #5

            Because it installs it, right.

            Christian Graus Driven to the arms of OSX by Vista. Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups