When trying to debug my web service today after upgrading the project to .NET 4, I was told by Visual Studio that it could not debug and to try running the project outside the browser. When I did, I received a 503 Error, Service Unavailable.
I check the Event Log and found this:
The worker process for application pool 'PartsWebService' encountered an error 'Cannot read configuration file due to insufficient permissions ' trying to read configuration data from file '\?C:WindowsMicrosoft.NETFrameworkv4.0.30319CONFIGmachine.config', line number '0'. The data field contains the error code.
Simple enough, I just have to give the correct permissions to that file. It seems that my service’s application pool identity doesn’t have rights. So I’ll navigate to the path that contains the machine.config and set permissions there.
You can’t just set permissions on the parent folder, you have to give permissions to the machine.config file itself. Add IIS_IUSRS from your local machine to the read and execute roles.
Also, load IIS Manager and check your application pool as this error usually stops the application pool if it’s running.
This should clear up any issues you were having.