I have an ActiveX component developed in C#. I'm referencing a dll which comes with other native dlls and it is loading them on the fly expecting them to be in the same folder (probably using Assembly.GetExecutingAssembly().Location
but not sure, I don't have control over them). There is also one ini
file which is also expected to be in the same folder.
When I run the application as Windows form app, everything is fine, of course. But the trouble comes when I run it within Internet Explorer as the base directory is at the location of iexplore.exe
. Obviously neither the dlls or the ini file can be found and many temporary working files outputted by the dlls are located in Internet Explorer folder.
The workaround is to copy all dlls and ini file into the ie folder but that is not something I'd be happy about. What is the proper solution to this? Can I somehow set the base path for the ActiveX component?