Check if Workstation if ESAPI will run on workstation

Aug 12, 2016 at 10:19 PM
I'm working on something that is a mix of database SQL processing and ESAPI. I'd like to be able to disable ESAPI functionality if the workstation is not capable of executing the code. I'd prefer not to do it with error handling if possible. Is there a way to check if the workstation can run ESAPI code?
Aug 12, 2016 at 10:48 PM
I am normally work from an eclipse thick client. I am working at another site and started to debug my stand alone ESAPI application, not thinking about what is installed on the workstation. The login screen appeared without issue and I didnt think twice. Thats what prompted the original question.Turns out practice management is installed on the workstation. Is that the reason I was able to get as far as I did? Id like to be able to get that far on any workstation (without installing anything) and then disable ESAPI if its not there. Is that possible?
Coordinator
Sep 10, 2016 at 10:10 PM
There's probably a better way, but you could check that the standard ESAPI assemblies are on the machine. I believe they're installed in standard locations, so you could hard-code the file paths (or at least put them in a configuration file).

You may also be able to handle the AppDomain.AssemblyResolve event to determine whether an ESAPI-related assembly couldn't be found.