OK thanks for your help so far. Another idea: Would it be a better idea to integrate/import the DLL(s) during run-time? So rather than including them via Visual Studio's "References" to include them directly in the classes that need them? I imagine that this way compiling would always be fine and that the statement could be put inside a try/catch structure so catching the situation when a DLL isn't available would be easier... Do you have any suggestions how this could be done? Thanks a lot!
Maercu
Posts
-
Testing the presence of a reference -
Testing the presence of a referenceWe're developing an application (.net 2.0 / C#) that interacts with Office and other external applications. So all needed references are added to Visual Studio's "References" and then used ("using x.y.z") in our sources. This works fine but what if someone (an enduser) doesn't have say MS Project installed? The sources won't compile, crying that "The type or namespace 'MSProject' does not exist ... (are you missing an assembly reference?)". Is there any possibility to make a (prior) test if a reference is available or not? Something like a try/catch surrounding the "using" statement? In fact we would like to test if MS Project (or another application) is installed and if not simply don't provide the functionality. I searched on MSDN, Google Groups, etc but did not find something useful... Thank you very much for your help!