I've inherited an older .NET WinForms project that includes multiple sets of Microsoft Office Interop references (Word, Excel, Core, VB, etc...the app works with these components to programmatically produce documents). One reference type looks like this:
<COMReference Include="Microsoft.Office.Interop.Word">
<Guid>{00020905-0000-0000-C000-000000000046}</Guid>
<VersionMajor>8</VersionMajor>
<VersionMinor>4</VersionMinor>
<Lcid>0</Lcid>
<WrapperTool>primary</WrapperTool>
</COMReference>
...which has no .DLL in the \bin folder or path to a .DLL elsewhere, so seems like a GAC reference.
And the other type is this, which does correspond to a .DLL in the project's \bin folder:
<Reference Include="Interop.Word, Version=8.3.0.0, Culture=neutral">
<SpecificVersion>False</SpecificVersion>
<EmbedInteropTypes>True</EmbedInteropTypes>
<HintPath>bin\Interop.Word.dll</HintPath>
</Reference>
...what is the difference between them? Are both needed?
Recently my machine couldn't build the project anymore, not sure why -- maybe IT pushed some Windows or Office updates that busted the interops or changed the GUIDs, I dunno. But removing the top one resolved the issue, so I'm trying to understand why they both exist in the project. The build issues were this:
MSB3283: Cannot find wrapper assembly for type library "Microsoft.Office.Word". 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.
I also can't figure out where the Microsoft.Office.Interop.Word comes from...I thought I'd try removing it and re-adding it, but I can't find it in the built-in libraries to add. Perhaps you have to add it from Office assemblies somewhere?
Thanks!