How to call ISAPI DLL from ASP.NET MVC?

805 views Asked by At

I am working on porting a legacy ISAPI DLL (it is an ISAPI extension, not filter) to ASP.NET MVC. Some of the functionality the ISAPI is implementing is quite complex, so ideally I would like to be able to call into the ISAPI somehow from ASP.NET.

One option would be to treat it like a webservice and perform an HTTP Request from inside ASP.NET to an exposed function in the ISAPI dll that performs what I need. That might work okay, it's just a number of extra hops to do what I need.

I was thinking about P/Invoking the ISAPI, but then I have to deal with passing an HTTPContext and so forth to it? Not sure if that's possible?

Any other options that I'm not aware of? Has anyone been down this path before? Thanks much!!

1

There are 1 answers

0
Shiv Kumar On BEST ANSWER

Your best best is to use the ISAPI as you've mentioned, that is use HttpClient or similar to make url calls into the ISAPI. You'll be surprised at how fast this ends up being - performance wise.