开发者

VSTO add-in not loading in Word 2010 with Windows XP

开发者 https://www.devze.com 2023-02-05 07:15 出处:网络
I have a VSTO addin for Word. Developed with Visual Studio 2010 (for Word 2007 and 2010) and also VS 2008 (for Word 2003).

I have a VSTO addin for Word.

Developed with Visual Studio 2010 (for Word 2007 and 2010) and also VS 2008 (for Word 2003).

It installs and runs in many different combinations of Windows (XP, Vista and Windows 7) as well as Office versions (i.e. Office 2003, 2007, 2010).

Except for one: Word 2010 on Wind开发者_运维百科ows XP (SP3).

The symptoms are that when Words starts up it appears to load the add-in for a while but in the end doesn't and the add-in appears in the Inactive Application Add-ins list.

There is code in the startup of the add-in that catches exceptions and reports on them, but that code never gets executed. So it seems that there is an exception somewhere before the add-in even starts executing.

That sounds something like an assembly not being found which makes me think maybe the Office 2010 PIA is not installed, but I tried installing that explicitly and it says it's already there (which is what is supposed to be the case because Office 2010 is supposed to install it (unlike previous Office versions which didn't install it)).

It would also be a symptom of something like the code not being trusted, but I have continued using the code trusting mechanism of caspol.exe, which seems OK with all the other mixtures of Office and Windows, so I'm guessing it's OK with O 2010 and W XP.

And if it was one "my" assemblies that was missing, then it would be missing when the add-in is installed on other Windows versions, because it's the same install regardless of OS.

I'm stymied.


After all, the answer is fairly simple:

It seems that when you install Office 2010 on Vista and Windows 7, the Office 2007 Primary Interop Assemblies are installed automatically. And the Office 2007 PIAs are the ones that are used with VSTO and Office 2010.

But: when you install Office 2010 on Windows XP (32 bit) (I haven't tried XP x64), the PIAs are NOT installed automatically. Then, if you try to run the o2007.msi installer that you can get from Microsoft, it tells you that it won't work unless Office 2007 is installed! Not very helpful.

However, after I stumbled on this StackOverflow question, I discovered that, of course, all you need to do is install the actual DLLs for the PIAs that you want into the folder where your executable runs from, and there you are!

0

精彩评论

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

关注公众号