C # Visual Studio: how to have multiple developers in a solution that references Office?

When I add a link to the Office COM Library, I have to go:

  • References
  • Add link
  • Select COM tab
  • Select Microsoft Office Object Library 12.0

And a magic named link will appear:

Microsoft.Office.Core

The Project.csproj file displays the link information:

<COMReference Include="Microsoft.Office.Core">
   <Guid>{2DF8D04C-5BFA-101B-BDE5-00AA0044DE52}</Guid>
   <VersionMajor>2</VersionMajor>
   <VersionMinor>4</VersionMinor>
   <Lcid>0</Lcid>
   <WrapperTool>primary</WrapperTool>
   <Isolated>False</Isolated>
</COMReference>

I check the project for the original control, and now no one can build a solution; they don’t have Office 12, they only have Office 11.

Another guy checks the .csproj file, removes the link to:

Microsoft Office 12.0 Object Library

and re-adds the link to COM as:

Microsoft Office 11.0 Object Library

After that, a new link will appear in the solution:

Microsoft.Office.Core

and the file Project.csprojcontains information about the link:

<COMReference Include="Microsoft.Office.Core">
  <Guid>{2DF8D04C-5BFA-101B-BDE5-00AA0044DE52}</Guid>
  <VersionMajor>2</VersionMajor>
  <VersionMinor>3</VersionMinor>
  <Lcid>0</Lcid>
  <WrapperTool>primary</WrapperTool>
  <Isolated>False</Isolated>
</COMReference>

: , , . , 2.3 2.4.

, Office 2007 ( Office 2000, ) , Visual Studio :

{2DF8D04C-5BFA-101B-BDE5-00AA0044DE52}\2.3\0\primary

, Office.

Office, , , intsalled?

, Office?


.. , Stackoverflow Office Visual Studio #?

, Office Visual Studio. .

+3
4

, , Office, . - Office 11 Office 12. . , factory .

+5

late binding to a type library is present, and the code to older interfaces - if you use v11 interfaces, you should be fine when you have v12 on the machine.

0
source

If you separate the interface from a separate project, you can then use vb.net and its built-in support for late binding to provide functionality and resource management.

0
source

All Articles