locked
Strong name signature not valid for this assembly Microsoft.mshtml.dll RRS feed

  • Question

  • I've a big project, always build with ClickOnceDeployment which worked always very nice....

    Now, my customer wants a new tool in his application, a HTML Editor tool, so I used the mshtml.dll to fix this. Everything works fine on my machine, but I have to "Exclude" the mshtml.dll in the "Application files" in the Publish tab while deploying. When I exclude this mshtml.dll, on every machine on which VS2008 is installed, it worked. On every machine without VS2008, it won't, telling the user that the mshtml.dll needs to be registered in the GAC.

    So, I tried to "Include" this mshtml.dll in the above window. Now, on every machine, after the update is downloaded, the user is presented with an "Cannot update application, view log....". When the log is viewed, I see this exception "Strong name signature not valid for this assembly Microsoft.mshtml.dll".

     

    I found on the internet that this assembly is delay/test signed (I don't know what it means), but they didn't come with a solution.

    So, how to succesfull include this dll (maybe I have to sign it, but how to sign a assembly?). The assembly can be found in the "C:\Program Files (x86)\Microsoft.NET\Primary Interop Assemblies" directory.

     

    Another option could be another HTML editor, without the use of the mshtml.dll. Does someone have an idea?

     

    I hope someone can help me, I'm strugeling for about 30 hours now...

    Tuesday, April 8, 2008 9:28 PM

Answers

  • Hi Webps,

     

    Based on my understanding, you want to include the MSHtml.dll in your application when packaging. But it throw an exception that "Strong name signature not valid for this assembly Microsoft.mshtml.dll". If I have misunderstood you, please feel free to tell me, thanks.

     

    According to my experience, the machine which has installed Visual Studio 2008, it has the MSHtml.dll registered in the GAL(Global Assembly Cache). So you need not include it in your application. However, when the machine dose not register MSHtml.dll in the GAC, so the application will register it, but you must signature it refer to SN.exe tool. You can refere to this link: http://msdn2.microsoft.com/en-au/library/k5b5tt23(VS.80).aspx  For something about delay signature assembly you can refer to this article from MSDN: http://msdn2.microsoft.com/en-us/library/t07a3dye.aspx

     

     

     

     

    Hope this can be helpful !

    Regards,

    Roy Zhou

    Monday, April 14, 2008 4:37 AM

All replies

  • Hi Webps,

     

    Based on my understanding, you want to include the MSHtml.dll in your application when packaging. But it throw an exception that "Strong name signature not valid for this assembly Microsoft.mshtml.dll". If I have misunderstood you, please feel free to tell me, thanks.

     

    According to my experience, the machine which has installed Visual Studio 2008, it has the MSHtml.dll registered in the GAL(Global Assembly Cache). So you need not include it in your application. However, when the machine dose not register MSHtml.dll in the GAC, so the application will register it, but you must signature it refer to SN.exe tool. You can refere to this link: http://msdn2.microsoft.com/en-au/library/k5b5tt23(VS.80).aspx  For something about delay signature assembly you can refer to this article from MSDN: http://msdn2.microsoft.com/en-us/library/t07a3dye.aspx

     

     

     

     

    Hope this can be helpful !

    Regards,

    Roy Zhou

    Monday, April 14, 2008 4:37 AM
  • Hi, people.

    I believe that I solved the problem, definitively, for "Strong name signature not valid for this assembly Microsoft.mshtml.dll"

     

    When we use a DLL witch is a ordinary Windows file the application, after installed by ClickOnce, try to use the system reference by the DLL, not that one Visual Studio used by build the our program.

    Then, to solve that, we must enforce the use of the correct file...

     

    1.       Open the “References” folder in Solution Explorer;

    2.       Click over the DLL name;

    3.       Look at property windows and certify you are using the correct version of DLL (in case of Microsoft.mshtml.dll, you must use the file in “C:\Program Files\Microsoft.NET\Primary Interop Assemblies\Microsoft.mshtml.dll”), verify it at property Path;

    4.       Then, attrib the follow properties:

      • Copy Local = True
      • Specific Version = True

     

    After this, you are sure that the ClickOnce will install and enforce the use of the DLL that you referenced in your project, avoiding the wrong reference by the default file installed by the windows or the MS Office.
    Friday, May 16, 2008 8:42 PM
  • Hi,

       I'm using ClickOnce deployment and encountered the same problem and have done all the steps mentioned above but problem still occurred.  However, I realised it's something to do with the signing cert for my case.  I'm using a test cert and its expiration date was one month ahead.  Therefore, I tried to re-create the test cert and run the installation program.  It works fine after doing that.

     

    For those who are using test cert, you can re-create it by going to

    Project > Properties > Signing

    click the "Create Test Certicate" button to generate a new cert.

     

    Under the Publish tab, click "Application files" button, make sure:

    for file name: Microsoft.mshtml.dll, select "Include" under under "Publish Status" dropdown.

     

    Re-build your solution and re-deploy it.  You will be prompted to overwrite the cert during deployment.

    Monday, June 16, 2008 2:34 AM
  • Hello everyone,

     

    I believe I have found an even more complete solution.  Thanks to Peter Gfader's blog at http://peitor.blogspot.com/2007/12/microsoftmshtml-dll-problems-und.html?showComment=1210971120000#c4537206934379287855 I found that the problem stemmed from the fact that all of my copies of Microsoft.mstml under C:\Program Files\Microsoft Visual Studio 9.0 are partially signed.  However, it looks like either the VS2008 installer or the 3.5 sdk installer adds Microsoft.mstml to the GAC.  Since Microsoft.mstml must have been fully signed to be added to the GAC, I was able to copy the assembly out of the GAC using the command prompt to get the strong-named version.  Then I explicitly referenced this copy in my projects, set Specific version = true and CopyLocal = true like Ricardo recommends, and now the ClickOnce deployment includes the strong named assembly.

     

    If you go this route you don't have to mess with sn.exe to sign mshtml (which you can't do to a partially signed assembly anyway), and you don't have to download the 2003 PIA's as described in Peter's blog.  Hope this helps save others some time and headaches.

     

    Patrick

    Friday, August 22, 2008 6:09 PM
  • Hi

     

    I also followed the same thing I have a success....

     

    What I did is I copied microsoft.mshtml.dll from C:\program Files\Microsoft.net\Primary Interop Assemblies\Microsoft.mshtml.dll and build my InstallShield project and deployed it in Windows 7 machine and this time I didn't get any error like "assembly signing problem for microsoft.mshtml"

     

    So Thank you very much for this answer

     

    Thank you

    Sandesh Daddi
    Sanshark

     


    sandesh
    Monday, April 12, 2010 7:11 AM
  • old issue, but i add the reference to the dll in the project and solucioned issue. this worked for me with others dll's like stdole.dll
    Sunday, October 16, 2011 6:04 PM
  • old issue, but i add the reference to the dll in the project and solucioned issue. this worked for me with others dll's like stdole.dll

    I'm having problems with this now with an app I wrote 4 or 5 years ago. It's complaining about, "Strong name signature not valid for this assembly stdole.dll". I don't even use that assembly in my app, but it's complaining about it. I am using Crystal Reports, so maybe there's some COM Interop going on. I am not signing this app, as it's run in-house and will only be run in-house. What kills me is that this app has been working FINE for years, with ClickOnce deployment. With NO CHANGE AT ALL to the app, it stopped being able to be deployed. Huh? Why is that?

    Well, I've tried it and it sort of worked. There are differences, though. No matter what I do, I cannot change stdole to CopyLocal. VS 2010 refuses to let me do anything at all with it. But it did install, at least on a 32-bit version of Windows. It doesn't work on a 64-bit version, but that's Crystal's problem.


    Rod

    Wednesday, November 20, 2013 5:43 PM