Oh I love errors! LOL…and I love posting about them because I learn something every time. With any issues comes solutions, always. You might not be able to find it the first time or the second time but over time, some way or another you’ll be lead to an actual solution. While working on an ASP.NET issue, I encountered an issue accessing an application. The error goes something like this:
[HttpException (0x80004005): Server cannot access application directory
Instantly, the first thing that come to my mind is the server’s security access or something that deals with permissions. Looking in the IIS application pool, I encountered another error while opening up an application’s properties.
Snap-in failed to initialize.
These types of errors are out of norm and are exceptions that needs to be dealt with properly since they’re “unknown” and in the server side of things.
1. Make sure that the project directory exists and has the proper permissions. In most cases, this is the issue. If this solution does not work, then proceed with step 2.
2. Microsoft did provide a solution via the command prompt on how to fix it but didn’t provide a “why” on the issue. This is a big deal because running a script does not guarantee a fix and second, running something without understanding the underlying process can cause more issues. This is like trying to learn Math and having the final solution without knowing the step by step process of achieving the final results. Same thing.
According to Microsoft’s documentation, running the code below should fix error.