0

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?

  • 1
    Can you go and configure its application pool not to use .NET Framework at all? That stops the behavior of loading things from bin folder. – Lex Li Dec 7 '16 at 6:03
  • @LexLi, yes, that did it! Can you enter it as an Answer so I can accept it? Note that this moved from StackOverflow to ServerFault, in case you're looking for it in the old location. – jimtut Dec 7 '16 at 14:49
0

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.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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