2

I have a virtual directory just above the root of my web app that I use to store product images.

After I installed ELMAH for logging I realized images stopped working. This was due to ELMAH looking for its dll under productimages/bin folder.

After i created a bin dir and placed the dll images are now working

I don't like this as a long term solution though. Any idea why it is doing this and how to fix?

2 Answers 2

5

The virtual directory inherits the configuration of your main application. To disable ELMAH in your virtual directory you need to add a web.config file to it with the following content:

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
    <system.webServer>
        <modules>
            <remove name="ErrorLog" />
            <remove name="ErrorMail" />
            <remove name="ErrorFilter" />
        </modules>
        <handlers>
            <remove name="Elmah" />
        </handlers>
    </system.webServer>
</configuration>

(make sure the names match those of your modules/handlers in the main web.config file)

-1

You could use some URL re-writing to direct productimages\bin at \bin in your solution could you not?

Kindness,

Dan

1
  • Woudn't work - .NET tries to load the DLL via the file system, not via a URL. Jan 12, 2012 at 11:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.