I recently got a question concerning ISAPI using managed assemblies.

Question:

Hello

First of all I developed an isapi extension that was a simple one. It was working properly. I then add referneces to some managed dlls in it and copied them into windows\system32\inetsvr folder and it still worked. But when i deployed it on other machines, it give me an error that file not found. I removed the wildcard mapping of that isapi extension from my system and then re-add it after restarting the iis and now it gives me the same error. if i used it without any reference, it works fine but with references it gives me the error. with references, i am still able to debug it and it goes well.

if im missing something them do let me know.

thanx in advance

Answer:

Since the plain ISAPI works just fine, I think you are hitting a couple different user misconfiguration issues that cause the "File not found" response to be sent.

Thus, my guess is that you either:

  1. Have "Check if file exists" checked for your Wildcard application mappings on IIS6. Simply removing and re-adding application mappings should not be problematic unless you failed to add them identically.
  2. Failed to deploy your managed assemblies correctly with your native ISAPI DLL. If your managed assemblies are GAC'd on your machine but not on the other machine, that could be a reason. Adding references inside of Visual Studio has no relevance on the resolution of the assembly at runtime.

Now, you can use FileMon from www.sysinternals.com and see what file is "not found" and make sure it is there. But, I would suggest that you first spend time figuring out how to correctly deploy your application (i.e. read the above URLs for how to deploy and troubleshoot assembly DLLs) instead of using this pragmatic approach because it only solves the problem, not necessarily correctly.

//David