I am writing an addin for Word 2000 in C#. The addin just calls a static
method called Launch from a dotfuscated library, which contains all the
actual content. The Launch method is the only exposed (non-obfuscated) method
in the library.
I can dynamically load the assebly and get the MethodInfo for the Launch
method. When I try to invoke it, however, a FileNotFoundException is thrown,
claiming that Interop.Word.dll could not be found. This file is included in
the deployment package and is in the ssame directory as the addin DLL. The
exception text shows that the CLR is looking in C:\Program Files\Microsoft
Office\Office\.
How can I direct the CLR to look in the right directory? I have seen some
suggestions to create an AppDomain, but I don't really understand how this
works, and, off hand, it seems like over kill.
TIA
"Peter Huang" [MSFT] - 03 Dec 2004 02:14 GMT
Hi
I think since the the addin is loaded in the winword.exe, so the appbase
where CLR checked as the base directory where the winword.exe located.
So far to make a simple test, you may try to copy the interop.word.dll to
the C:\Program Files\Microsoft Office\Office\ to see if that works.
If yes, I think we may try to build a office 2000 PIA which will be put
into GAC, so that the CLR will check the GAC anyway.
Here is link about office 2000 PIA generator.
http://groups.google.com/groups?hl=zh-CN&lr=&c2coff=1&threadm=M54apYQ0EHA.30
28%40cpmsftngxa10.phx.gbl&rnum=3&prev=/groups%3Fq%3D%2522peter%2520huang%252
2%2520office%25202000%2520PIA%26hl%3Dzh-CN%26lr%3D%26c2coff%3D1%26sa%3DN%26t
ab%3Dwg
Best regards,
Peter Huang
Microsoft Online Partner Support

Signature
Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.