How To Add Reference To Interopiwshruntimelibrary
LINK https://urlgoal.com/2sW0pT
Visual Studio generates an interop assembly containing metadata when you add a reference to a type library. If a primary interop assembly is available, Visual Studio uses the existing assembly before generating a new interop assembly.
I have an application that creates desktop shortcuts. To do this I have to reference the Windows Script Host Object Model. When I add it as a reference, it always creates the DLL, Interop.IWshRuntimeLibrary.dll, in the obj\x86\Debug directory, then references itself to it, rather than looking at wshom.ocx. Even if I add reference wshom.ocx it reverts to saving the file in the obj\x86\Debug directory. The problem is if I move my application to another computer without that DLL being present, the program fails to run.
In other cases, these errors can be related to corrupt Windows registry entries. These broken entries could result in moved DLL file, missing DLL file or a leftover DLL file reference in your Windows registry.
I have an application that creates a shortcut to a folder. I have the IWshRuntimeLibrary as a reference and it all works fine while debugging in visual studio. I see it copies this C:\Windows\System32\oem\Interop.IWshRuntimeLibrary.dll library from the sys32 folder to the project's obj\x86\Release folder.
It is not necessary to sign your app in order to use signed assembly IWshRuntimeLibrary. Just add reference in your app to signed version of IWshRuntimeLibrary. In this case both your app and library will use the same signed version of IWshRuntimeLibrary.
In simple words, it can't find the assembly that was referenced. Make sure it can find the right assembly by putting it in the GAC or in the application path. Also see -located-assemblys-manifest-definition-with-name-xxx-dll-does-not-match-the-assembly-reference.
3. At this time, the references list will add a new item: Windows Script Host Object Model, please select this reference and press , double-click Path property, copy the full path of this wrapper assembly, like this: 2b1af7f3a8