I have created a VSTO Word Addin. It has generated a DLL file. I don't want to deploy that as an EXE. But I want to use a C# application(EXE) to call or invoke this VSTO dll. Is this possible? If possible how do I implement?
Please note that I don't want to deploy my Addin as an EXE. I only want my VSTO addin to remain as a DLL and then to be called from an EXE.
I have tried the below approach with no luck.
1) WordAddIn.ThisAddIn addin = new WordAddIn.ThisAddIn(null, null);
Here the WordAddin is the VSTO dll.
2) Using Reflection
Assembly newAssembly = Assembly.LoadFile("C:...bin\\Debug\\WordAddin.dll");
Type[] types = newAssembly.GetExportedTypes();
Type entryType = newAssembly.GetType("ThisAddin");
object o = Activator.CreateInstance(types[0], true);
I get 'No parameterless constructor defined for this object.' in this case.
Unable to go further!. Kindly suggest.