IIS Application to exclude “bin” directory

iisiis-8webdav

We're trying to setup IIS as a WebDAV server, using a new "app" created in IIS and available at http://servername/Shares/. This "app" points to a folder on the local server that is also shared through Windows Sharing as \servername\Shares. (I keep using quotes around "app" because there is no custom code written here, it's just configuring an IIS application to point to a local folder.)

This local folder has a subfolder called "bin", which has always been accessible as \servername\Shares\bin. There are lots of DLLs and EXEs in there that our users use, some from MS, some open-source/free, some are our own. We can't move this folder without impacting a LOT of users.

Unfortunately, this "bin" folder is getting treated by IIS as the "bin" folder for an IIS/ASP application, and IIS is trying to load all the DLL's in the folder. Accessing http://servername/Shares gives the following error:

Could not load file or assembly 'msvcm80' or one of its dependencies. An attempt was made to load a program with an incorrect format.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

Exception Details: System.BadImageFormatException: Could not load file or assembly 'msvcm80' or one of its dependencies. An attempt was made to load a program with an incorrect format.

We do NOT want IIS to load this DLL or any other from this "bin" dir. I've tried setting up a web.config like this to NOT load the DLL's, but it isn't working:

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.web>
    <compilation>
        <assemblies>
            <remove assembly="*" />
        </assemblies>
    </compilation>
  </system.web>
  <system.webServer>
    <directoryBrowse enabled="true" />
  </system.webServer>
</configuration>

Any suggestions?

Best Answer

You can go and configure its application pool not to use .NET Framework at all. That stops the behavior of loading things from bin folder.