C# .NET - Installation error (Microsoft.Mshtrml.dll could not load)?

Asked By svt gdwl on 08-Mar-10 12:50 AM
Hi,

   I had a setup (of plugin of IE) (named Setup1) build in vs2005. Earlier If I used to install this setup on other PC's which doesn't have vs2005 and has only .Net framework2.0, the setup gets successfully installed.


After few days, I had installed vs2008 in my PC. After that, I had took the code of Setup1, rebuilt the dll, made a setup (named Setup2) using vs2005. 

The main thing is, I had observed one thing, the new setup (i.e., Setup2) gets successfully installed on developing machines, but it gives the following installation error on the machines which does not have vistualstudio, eventhough, .Netframework2.0 and windowsinstaller3.1 is present. The error is:

Exception occured while initializing the installation:
System.IO.FileLoadException: could not load file or assembly 'Microsoft.mshtml.dll, Version=7.0.3300.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. StrongName validation failed. (Exception from HRESULT:0x8013141A).


But on the same, Setup1 gets succesfully installed. But setup2 gives this installation Error.

If I run vs_piaredist.exe first and then run the Setup2,  Setup2 also gets successfully installed.

Why is this happening with Setup2? why doesn't this happen with Setup1?
Peter Bromberg replied to svt gdwl on 08-Mar-10 08:06 AM
The message tells you everything. Whatever version of MSHTML it is trying to load, it's been told that the assembly has a strong name, and the one it is trying to load does not have the correct metadata.  Make sure you interop assembly is included in the setup and that you've given it a strong name in your build setup.