MSHTML DLL on Windows 10

后端 未结 8 1584
心在旅途
心在旅途 2020-12-13 18:13

I have a C# solution that makes use of Smith Html Editor (I\'m developing on the main project which uses this, so I don\'t know much about this library), which makes a refer

相关标签:
8条回答
  • 2020-12-13 18:52

    Great solution Aron!

    In my case it was:

    CD C:\Program Files (x86) [Enter]
    CD Microsoft Visual Studio\2019 [Enter]
    CD Community\Common7\IDE\PublicAssemblies [Enter]
    gacutil -i Microsoft.mshtml.dll [Enter]
    exit
    

    (I wrote these on seperate lines since word-wrap made it confusing to read).

    0 讨论(0)
  • 2020-12-13 18:53

    In case if all of the above failed to work for you, here's my solution which is different to the above and it worked for me:

    I registered the microsoft.mshtml.dll in the global assembly cache.

    Here is the solution:

    Step 1: Open the Developer Command Prompt by typing dev in your windows 10 search box and right click the Developer Command Prompt for VSxxxx and run as administrator

    Step 2: Navigate to your microsoft.mshtml.dll library. In my case:

    CD C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\PublicAssemblies>
    

    Step 3 Run the following command to register in the global assembly cache:

    gacutil -i Microsoft.mshtml.dll
    

    For more information visit this web article: https://docs.microsoft.com/en-us/dotnet/framework/app-domains/how-to-install-an-assembly-into-the-gac

    0 讨论(0)
  • 2020-12-13 18:59

    MSHTML is still an important component in Windows 10, even with Edge as the default browser. You can find it in "C:\Windows\System32". To quote from the official FAQ:

    http://dev.modern.ie/platform/faq/will-the-webbrowser-control-work-with-mi

    MSHTML:

    In Windows 10 the WebBrowser control will use Internet Explorer’s legacy rendering engine, mshtml.dll. At this time EdgeHTML is not available through the WebBrowser control.

    EdgeHtml

    In Universal Windows Apps built for Windows 10, the WebView control use Microsoft EdgeHTML. WebView controls in apps built for Windows 8 & 8.1 will continue to load the MSHTML to preserve compatibility.

    0 讨论(0)
  • 2020-12-13 19:01

    Using VS 2015 I had this issue after the last Windows 10 update. I removed the reference "Microsoft HTML Object Library" and added it again to the project. This resolved the issue in my case.

    0 讨论(0)
  • 2020-12-13 19:02

    For some reason in my case the Microsoft.mshtml file was located in a different directory. On Visual Studio, double click the assembly reference, and you'll find the path to it. Now open the "Developer Command Prompt for VS2017", type the following cd C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\PublicAssemblies. Then regasm Microsoft.mshtml.dll.

    0 讨论(0)
  • 2020-12-13 19:03

    I just created a blog post on this issue. The problem is that the Microsoft.mshtml.dll assembly in the Global Assembly Cache becomes unregistered from ActiveX during the upgrade process. To fix this issue, it is necessary to run "regasm" on the assembly:

    1. Open an instance of "Developer Command Prompt for VS2013" (or whatever version of Visual Studio you happen to be using). Run it as Administrator by right-clicking the icon and selecting, "Run as Administrator."
    2. Navigate to "C:\Windows\assembly\GAC\Microsoft.mshtml\7.0.3300.0__b03f5f7f11d50a3a." It is possible your path will vary. To verify, go to "C:\Windows\assembly\GAC\Microsoft.mshtml" and type "dir."
    3. Once you are in the correct path, type regasm Microsoft.mshtml.dll
    0 讨论(0)
提交回复
热议问题