Could not load file or assembly 'Microsoft.mshtml … Strong name validation failed

前端 未结 4 583
时光取名叫无心
时光取名叫无心 2020-12-05 14:26

I made a WPF/C# program and I am using the internet control for WYSIWYG HTML editing.

it is a regular Executable program.

it works on most computers however

4条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-12-05 15:15

    Microsoft.mshtml.dll from PIA folder is not signed.
    If you have signed project, you must take version from "Primary Interop Assemblies" folder.


    To do that:

    1. Remove reference to Microsoft.mshtml (if you have one in your project)

    2. Click "Add Reference" and than DO NOT select "Extensions" but "Browse" and point to "C:\Program Files (x86)\Microsoft.NET\Primary Interop Assemblies" (for .64 bit Machines) - that version is signed.

    3. Edit properties (select microsoft.mshtml reference and press F4) in order to set:

    Embed Interop Types=false
    Copy Local=true


    4. Rebuild your project

提交回复
热议问题