Is there a summary somewhere of the issues around calling an unmanaged DLL from ASP.NET? I know how to do p-invoke, but does IIS need extra configuration? Is it likely to be a performance or scalability problem? Is it necessary to use COM interop or a mixed-mode assembly? Context: early planning stages of migrating a Windows app to an ASP.NET web app.
+1
A:
The main issue will be that the native code was written in a different context. It expects to be a desktop application, running for a single user, and probably on a single thread. If you run it in ASP.NET, it will be handling multiple users, and will be running on multiple threads at the same time. This can easily break it.
John Saunders
2009-08-12 09:52:56
well, that would be a problem for reasons other than being a native code dll. Putting aside those potential issues, are there problems with p-invoke in this context?
2009-08-12 10:30:39
The issue I raised is simply more likely with a native code DLL, as the assumptions it's been operating on haven't changed in a long time.
John Saunders
2009-08-12 10:37:47
A:
Probably security would be your big problem; I take it your not in some sort of partial trust situation though.
I mean it's obvious; generally you'd avoid it, but if you can't, then do it as little as possible for as least time as possible.
Noon Silk
2009-08-12 09:53:04