FIX for Wrapper assembly for type library “MSHTML” cannot be found after Windows 10 upgrade.

Here we will see how to resolve an issue that comes after you have upgraded to Windows 10. After upgrading the system visual studio started showing errors that Metadata file .dll could not be found. After re-building, re-starting the solution as well as changing the references nothing changed and the errors still appeared. If you closely look at the Build failed errors you will find the below para.

C:\Program Files (x86)\MSBuild\12.0\bin\Microsoft.Common.CurrentVersion.targets(2234,5): warning MSB3283: Cannot find wrapper assembly for type library “MSHTML”. Verify that (1) the COM component is registered correctly and (2) your target platform is the same as the bitness of the COM component. For example, if the COM component is 32-bit, your target platform must not be 64-bit.

Now this is very the problem is. If you check your references you will find an yellow warning mark to MSHTML. If you check this with your windows 8.1 machine it will be pointing to an ActiveX control that was registered from a file in GAC.

When you upgrade your system Microsoft.mshtml.dll assembly in the Global Assembly Cache becomes unregistered from ActiveX during the upgrade process. Fix for this is to run “regasm” on the assembly.

Step 1) Open an instance of “Developer Command Prompt for VS2015”. Make sure you open it as Administrator.

Step 2) Navigate to “C:\Windows\assembly\GAC\Microsoft.mshtml\7.0.3300.0__b03f5f7f11d50a3a.”
To verify, go to “C:\Windows\assembly\GAC\Microsoft.mshtml” and type “dir.”
Once you are in the correct path, type regasm Microsoft.mshtml.dll

download

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s