So I'm helping a client solve an issue on their webpage. I got the following message for their index.aspx file: Directory 'C:\Inetpub\wwwroot\site\XXXXXX\BIN' does not exist. Failed to start monitoring file changes. 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.Web.HttpException: Directory 'C:\Inetpub\wwwroot\site\XXXXXX\BIN' does not exist. Failed to start monitoring file changes. Source Error: An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below. Stack Trace: [HttpException (0x80070002): Directory 'C:\Inetpub\wwwroot\site\XXXXXX\BIN' does not exist. Failed to start monitoring file changes.] System.Web.DirMonCompletion..ctor(DirectoryMonitor dirMon, String dir, Boolean watchSubtree, UInt32 notifyFilter) +139 System.Web.DirectoryMonitor.StartMonitoring() +42 System.Web.DirectoryMonitor.StartMonitoringFile(String file, FileChangeEventHandler callback, String alias) +154 System.Web.FileChangesMonitor.StartMonitoringDirectoryRenamesAndBinDirectory(String dir, FileChangeEventHandler callback) +413 System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +331 [HttpException (0x80004005): ASP.NET Initialization Error] System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +983 I did some poking around on their server and realized that their "bin" directory is missing. Yet I cannot make a new "bin" directory. I was finally able to access it on command prompt and the dll file is still there. I played around with the user permission settings last night and got it to work. However, it stopped working today again despite the permission changes unchanged from last night. Has anyone here encounter this before? If so, I need help!
I am NO ASP.net developer, but did you try searching the http://support.microsoft.com knowledge base for specific text in your error message? http://support.microsoft.com/search/default.aspx?qu=System.Web.HttpException
I've had no luck on the support page. I tried googling the issue too, but I couldn't find something I can use. Actually, this may be a Windows Server or IIS issue because the "bin" directories are hidden from view even if "show hidden files" is turned on. I can only access it if I go into command prompt.
Go into the MMC for IIS and first of all BACK UP the configuration with the IIS Back up tool you can access from right-clicking "Web Sites" on the tree on the left pane. After you're done backing it up, go to "Administrative Tools" on your programs or Control Panel menu, and select the ".Net Permissions Wizard" or the ".NET Security Wizard" or something like that (I don't have that on my regular workstation). Try to figure out if the folder is hidden from the computername_iuser user, or if there are security restrictions on the folder. If it is hidden, you may need to "unhide" it. Open the Folder Options... on the folder above "bin" and allow your administrator-accessible user to see hidden files, and you should be able to see and then configure permissions on the individual folder. DAMN, not being able to see your screen is difficult...
The bin folder for the website should be created when the project is created if they are using Visual Studio. As I'm sure you know this is where all the dlls are that the website references if copy local = true. When you copy the project from VS, it will copy all the files under that site (bin folder and contents included) if the default settings aren't monkeyed with. I've never had a bin folder where I couldn't see it from IIS or Windows Exployer on the target or the source side. Assuming they did things the normal way, this shouldn't be. I have seen virtual directories "disappear" in IIS (really they were there but you just can't see them after closing IIS from the initial create) - a bug in XP sp1 that XP sp2 fixed, but I've never seen what you are describing. Sorry that wasn't much help.
I develop all my stuff on a workstation. That way I always have to copies and can revert back, if I need to. Does the project work on the local workstation? If so, then recompile the project and copy it to a test directory on the server. In IIS, right-click on the new folder and select properties. Inside the properties window, click the "Create" button. This will provide default permisions. If it does not report the same error, then it could have to do with permissions. What are you permissions on the bin folder?
The project was actually delivered and went live maybe a month or two ago. It was working fine until one day, the bin directory disappeared. I can still access it on command prompt if I "cd" into it. However, it does not show up on Windows Explorer or when I "dir" the web directory. This sounds like either a Windows Server 2003 issue or even a malicious process running. I don't know. Any advice?
Perhaps you should do an integrity check on the partition. Does the project require any special permissions? If not, then create a new folder. Copy the project over and recompile. What do your references look like in the project?
ok... since I have access to the bin folder using cmd prompt. I am wondering if I can access permission settings using cmd prompt.
IIS backs up the metabase automatically sometimes on system checks. Can you go back to that time? back it up. Do you know how to do that in IIS? See if the .Net config. wizard has something like that... I haven't had much time to play around with .Net, but I know you can restore metabases.
I didn't develop the project myself, we out-sourced it because I'm only experienced in PHP. While I do have the files, I haven't figured out how to open the project on my workstation. As far as permission goes, it ought to be generic. Copying the project sounds like a good idea, I'll look into it now.
Copying didn't work... I created a new directory and tried to create a "bin" folder, but the system didn't let me. I then tried to delete the directory I created, but it's now saying the directory is not empty. I looked into windows explorer and it looked pretty empty to me.
Perhaps there are hidden files. Did you get the same message? Highlight the project folder and select copy (this should copy everything underneath, including the bin folder). Then right click and select paste. You should see "Copy of.." the folder name. Rename it and perform the "Create" instruction in IIS that I talked about earlier. Then recompile the project.
I went into the command prompt and use "rd" to remove bin despite bin not showing up on "dir". Anyway, this problem is getting out of hand. Think I'll outsource the troubleshooting to the service provider.