I have a requirement where i use the microsoft powerpoint functionalities to convert ppt to video file using Microsoft core dlls in c#. I have Microsoft office 2010 installed on my machine. So the code compiles properly as it finds the dlls present in the GAC.
Now i wanted to compile the same code on the machine that do not have Microsoft office 2010 installed.
Is it possible to do using the conditional compilation constants or is there any way round for the same?
Thanks, Karan
No, conditional compilation is only compile time definition.
What you can think about is about dependency injection. In this way, you have not to define a relation between your assembly and office assemblies at compile time, but will load that assembly into the memory on request at runtime.
For an example may have a look on:
Dependency Injection: A Beginner’s Guide
or for more comlete (but also more complicated!) solutions in
Which .NET Dependency Injection frameworks are worth looking into?