Reference to exe in a .Net 4.6.1 project

61 Views Asked by At

I need to make API calls to methods in an EXE provided by a software company. In the past very old .Net version, I was able to make it work by renaming the exe to dll (I guess?). This time around the EXE they have provided seems to have been compiled in 4.6.1. I am not able to make it work and it causes runtime errors: "Could not load file or assembly... A strongly-named assembly is required"

What are my options? Is it still possible to make API calls to an EXE whether or not I rename it to a DLL? Or Should I ask them to provide me a proper DLL?

Thank you.

1

There are 1 best solutions below

0
On

Thanks to @vasily.sib and the following link, I was able to resolve this issue.

I can in fact reference any EXE assembly in the project and call methods on it. An EXE (and for that matter a DLL) can be strong named and signed by anyone, and not just by the developer who has the source code for that EXE. See the following link for details.

Thank you.

https://chrisbenard.net/2009/07/16/strong-name-an-assembly-without-source-code/