开发者

Microsoft.Office.Interop assembly issue

I have recently released a client application built in visual studio 2010 and it seems to have used newer libraries then a previous release and is causing errors. I have whittled the issue down to this import: Imports Microsoft.Office.Interop. Is there a way to use this import and support multiple versions?

Here is the error:

Unable to install or run the application. The application requeres that assembly Microsoft.Office.Interop.Outlook Version 11.0.0.0开发者_开发技巧 be installed in the Global Assembly Cache (GAC) first.

As a possible but untested solution I have found the Redistributable Primary Interop Assemblies: http://www.microsoft.com/downloads/en/details.aspx?FamilyID=59daebaa-bed4-4282-a28c-b864d8bfa513&displaylang=en but I am nervous that updating this may cause errors with older windows applications. Would you say bundling this with the installer would be safe?


Yes, the Office 2003 PIA will fix your problem. Clearly it isn't installed so there's little reason to fear you breaking anything.

Another way is to not use the PIA, it is pretty uncommon to actually need one. Open the Reference node in the Solution Explorer window, select the Outlook reference. In the Properties window set Copy Local to True. Build. You'll get the interop libraries (office.dll and microsoft.office.interop.outlook.dll) in the build directory. Deploy them along with your own assemblies.


The link you provided is for Office 2007 PIA which refer to version 12.0 and not the version your application is requiring.

You should instead use:

Office 2003 Update: Redistributable Primary Interop Assemblies

As to to your specific question I've been bundling this packages with applications, more specifically Office Add-ins and never had a problem with compatibility with other applications.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜