Monday, November 23, 2009

IIS Admin Scripts (adsutil.vbs, stopweb.vbs, contsrv.vbs, etc)

Typically when I do an install of IIS, I delete everything out of the root folder or I move it. The other day, I was in need of adsutil to increase the max connections on an install I was doing. Since I had deleted the scripts earlier, I looked around the web to find them, but nobody had that file. Lots of articles talking about it and how to use it. Nobody had it though.

So I've gone and made them available. I found a copy on my XP virtual server. The zip file contains the following:


  • adsutil.vbs

  • chaccess.vbs

  • contsrv.vbs

  • contweb.vbs

  • dispnode.vbs

  • disptree.vbs

  • findweb.vbs

  • mkwebdir.vbs

  • pausesrv.vbs

  • pauseweb.vbs

  • startsrv.vbs

  • startweb.vbs

  • stopsrv.vbs

  • stopweb.vbs

  • synciwam.vbs



As I mentioned, these are straight from an XP install. It's everything that was in the admin scripts folder.

Tuesday, November 10, 2009

Could not load file or assembly 'app_code'

Most (if not all) of the stuff I post on this blog is about errors I have come across that took me more than a few minutes to solve. This is another of those. A web application I installed was throwing this odd error message:

Could not load file or assembly 'app_code' or one of its dependencies. Access is denied.


The strange thing was that this was a precompiled .Net (3.5) application. It didn't need app_code, and I wasn't sure why on earth it was trying to access a folder that didn't exist. I searched web.config for references to it and found nothing. I even created the folder to see what it would do, but it didn't like that either.

This server it was installed on has been behaving badly. After some poking around, I discovered that the root folder for the website didn't have two key permissions, "ASPNET" and "Network Service". I added both with read permissions and the problem went away. Now, I don't know which one fixed it, and since I was pressed for time to bring the site up, I left both of them. In hindsight, I should have removed each of them one at a time to find which fixed the problem (or if they were both needed).

Anyway, long story short, adding those two to the security of the root folder fixed the problem. It actually complained about not needing app_code for a precompiled application, so I removed the folder I had created to find the problem and suddenly the site was working again.