Question

I have a site structure like this:

enter image description here

And I'd like to use a relative path to my test_isapi.dll in the web.config for the ISAPI application. I've tried replacing C:\TestSite1\TestSite2\ISAPI\test_isapi.dll with the following relative paths with no luck:

  • test_isapi.dll
  • ~/test_isapi.dll
  • ~\test_isapi.dll
  • ISAPI\test_isapi.dll

Do I have the syntax wrong for the relative path, or is this just not possible for handler settings in the config?

Current (working with absolute path) web.config (TestSite1/TestSite2/ISAPI/web.config):

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
  <system.webServer>
    <handlers>
      <add name="Test ISAPI"
           path="*"
           verb="*"
           modules="IsapiModule"
           scriptProcessor="C:\TestSite1\TestSite2\ISAPI\test_isapi.dll"
           resourceType="Unspecified"
           requireAccess="None"
           preCondition="bitness32" />
    </handlers>
  </system.webServer>
</configuration>
Was it helpful?

Solution

My solution was to programmatically check and add the handler mapping instead of deploying the setting with the web.config. That way I can determine the absolute path at run-time and apply the setting. Not ideal, but it gets the job done.

See this answer: How to add IIS handler mapping programmattically

OTHER TIPS

config you can write ~/filepath

To use a relative path just Add ~/test_isapi.dll for ISAPI Site webconfig.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top