-1

I am currently working on a project which uses a 16 MB dll, but my program is only 23 MB. If I add the dll, the total project size will be 39 MB, which I want to avoid for performance reasons. Is there any way that I can fetch the dll (only when needed) from the server in the background?

I already have a progress bar for the process in which the dll is being used.

I'm looking for an option that isn't too time-consuming.

Edit:- My Application is Click once Application

Lucifer
  • 1,594
  • 2
  • 18
  • 32
  • take a look at this https://support.microsoft.com/en-gb/kb/837908. I have done this before on other projects and my code is on a different machine. If this doesn't help you I will dig out the old code – Simon Price Dec 28 '16 at 12:54
  • and when you say its not ok for program performance can you please expand on what you mean – Simon Price Dec 28 '16 at 12:54
  • @SimonPrice the dll is just used for a single line code and I have tried other dll but none of them gives me positive result so I have to use this dll and my superiors don't want to increase the size that much – Lucifer Dec 28 '16 at 12:57
  • Can you explain more what you mean with performance reason ? I dont see how adding the dll will decrease the performance but I can be wrong offcourse – GuidoG Dec 28 '16 at 13:55
  • what is it that this DLL \ one line of code is doing? – Simon Price Dec 28 '16 at 14:25
  • Alternatively, instead of dynamically fetching dll from server you can expose the (whatever function you need) as web service and just consume it. – Ondrej Svejdar Dec 28 '16 at 14:28
  • The DLL is docotic-pdf and it is parsing the PDF files for me @simonprice – Lucifer Dec 28 '16 at 15:05

1 Answers1

1

You can download the dll and then run the dll dynamically using this:

Assembly assembly = Assembly.LoadFile(@"C:\dyn.dll" /*DLL Location*/);
Type     type     = assembly.GetType("TestRunner"/*Class Name*/);
var      obj      = Activator.CreateInstance(type);
Guy Cohen
  • 101
  • 1
  • 4