M
Michael H
Hi all,
I am trying to write code that works against Microsoft Office Primary
Interop Assemblies (PIA) and Windows Desktop Search (WDS). The problem
is, whereas I have these available on my dev machine and have written
a lot of functionality regarding these DLLs and placed them into my
own DLL to be consumed by another application, I can't know nor be
guaranteed if such Assemblies/DLLs even exist on deployed PCs. If I
try to catch the fact that the DLL isn't available, it will work
within the DLL I create, or at least it appears to, but I can create
an instance of the class that works against these missing DLLs from my
application. It seems I can't try/catch the fact that there's a
missing Assembly trying to be accessed by the functionality in the
DLL. I'm not sure that I'm explaining this very clearly so I'll type
some basic scenarios below.
1) I write a class that creates a DesktopSearch Object from the WDS
DLL. If this WDS DLL isn't on the machine, an exception occurs that I
can catch within this class I'm writing. All seems ok. I compile this
project into a DLL. I'll call this myDLL.dll
2) My main application which would like to use some of the
functionality I wrote in myDLL.dll works fine unless that WDS DLL is
missing. Now, instead of the functionality inside myDLL.dll catching
the exception and moving on, the same exception is caught in my main
application. This leads me to think the fact that the WDS DLL is
missing on a machine and there are references to it in myDLL.dll
raises an Exception in its own right.
So, I'd like to be able to just determine whether specific Assemblies
are available at runtime and write a DLL that uses some functionality
from the Assemblies if they are without causing problems when they're
not down the line when other applications consumes my DLL.
I am trying to write code that works against Microsoft Office Primary
Interop Assemblies (PIA) and Windows Desktop Search (WDS). The problem
is, whereas I have these available on my dev machine and have written
a lot of functionality regarding these DLLs and placed them into my
own DLL to be consumed by another application, I can't know nor be
guaranteed if such Assemblies/DLLs even exist on deployed PCs. If I
try to catch the fact that the DLL isn't available, it will work
within the DLL I create, or at least it appears to, but I can create
an instance of the class that works against these missing DLLs from my
application. It seems I can't try/catch the fact that there's a
missing Assembly trying to be accessed by the functionality in the
DLL. I'm not sure that I'm explaining this very clearly so I'll type
some basic scenarios below.
1) I write a class that creates a DesktopSearch Object from the WDS
DLL. If this WDS DLL isn't on the machine, an exception occurs that I
can catch within this class I'm writing. All seems ok. I compile this
project into a DLL. I'll call this myDLL.dll
2) My main application which would like to use some of the
functionality I wrote in myDLL.dll works fine unless that WDS DLL is
missing. Now, instead of the functionality inside myDLL.dll catching
the exception and moving on, the same exception is caught in my main
application. This leads me to think the fact that the WDS DLL is
missing on a machine and there are references to it in myDLL.dll
raises an Exception in its own right.
So, I'd like to be able to just determine whether specific Assemblies
are available at runtime and write a DLL that uses some functionality
from the Assemblies if they are without causing problems when they're
not down the line when other applications consumes my DLL.