locked
LoadWithPartialName RRS feed

  • Question

  • What's the latest with LoadWithPartialname()?  Do we still continue to use with #pragma overrides?  What is the alternative if I simply want the latest version or whatever version of Microsoft.Office.InterOp.Outlook in the user's PC?  Especially when it's one year later and the users are all having Office 2010.

    Thanks.
    Wednesday, October 7, 2009 4:14 PM

Answers

  • VS doesn't install any, no idea where yours came from.  PIAs tend to pop up from nowhere, I've got three for mshtml whose origin I don't know.  That's COM DLL Hëll knocking at the door.

    Yes, the PIA must be present in the GAC on the target machine, you may distribute it.  Note that a PIA isn't actually required if you don't share office types between different programs.  You'll get a local copy in your build folder when you set the Copy Local option for the COM references to True.  It is big, but you'll avoid the versioning and deployment hassles.

    Hans Passant.
    • Marked as answer by eryang Monday, October 12, 2009 7:14 AM
    Thursday, October 8, 2009 4:25 PM

All replies

  • Perhaps you misinterpret the meaning of the Obsolete attribute.  It doesn't mean "ignore it with a #pragma", it means "stop using it".  Either deploy the PIA for the minimum Office version you are willing to support or use the <bindingRedirect> element in the app.config file.  "Running with the latest version" otherwise doesn't make a lot of sense, you probably didn't test your code nor use the added interfaces of that latest version.  COM interfaces are immutable, it is Microsoft's burden to make an old interface work in a new release of their software.

    Hans Passant.
    Wednesday, October 7, 2009 4:43 PM
  • Sorry I am confused now.  I need to start from the beginning.

    My PC has both VS 2008 and Office 2007.   When I go to Add Reference in a VS project, I see:

    a. Microsoft.Office.Interop.Outlook 11.0.0.0 v1.1.4322
    b. Microsoft.Office.Interop.Outlook 12.0.0.0 v.1.1.4322

    Are these two DLLs put there by VS or Office?  It seems that they are provided by VS as the DLLs are in a sub-folder beneath C:\Program Files\Microsoft isual Studio 9.0.  If so, when my program is distributed to a user PC, the user PC won't have the requisite DLL.  Does it mean that I have to package the DLL along with my program?  Am I allowed to distribute the PIA?

    Thanks.
    Thursday, October 8, 2009 2:45 PM
  • VS doesn't install any, no idea where yours came from.  PIAs tend to pop up from nowhere, I've got three for mshtml whose origin I don't know.  That's COM DLL Hëll knocking at the door.

    Yes, the PIA must be present in the GAC on the target machine, you may distribute it.  Note that a PIA isn't actually required if you don't share office types between different programs.  You'll get a local copy in your build folder when you set the Copy Local option for the COM references to True.  It is big, but you'll avoid the versioning and deployment hassles.

    Hans Passant.
    • Marked as answer by eryang Monday, October 12, 2009 7:14 AM
    Thursday, October 8, 2009 4:25 PM