“Cannot read configuration file” Error when accessing the image from the virtual directory on IIS whose physical path is network folder

asp.netiis

I have deployed my application on IIS 7.0. I wanted a shared Image folder in my application, so I created a virtual directory inside my deployed application on IIS.

I set the physical path for this virtual directory to a shared folder on another machine. Now when I try to browse any image from this shared folder I get the following error:

HTTP Error 500.19 – Internal Server Error

The requested page cannot be accessed because the related configuration data for the page is invalid.

Detailed Error Information:
Module IIS Web Core
Notification BeginRequest
Handler Not yet determined
Error Code 0x8007052e
Config Error Cannot read configuration file
Config File \?\UNC\WINSERVER1\hpu_images_staging\web.config
Requested URL http://[IPAddress]/Images/Temp_Harsh/photos/086b88b9-a228-4e0d-ba29-436c74ff5258.jpg
Physical Path \WINSERVER1\hpu_images_staging\vetphotos\086b88b9-a228-4e0d-ba29-436c74ff5258.jpg
Logon Method Not yet determined
Logon User Not yet determined
Failed Request Tracing Log Directory C:\inetpub\logs\FailedReqLogFiles

How do I resolve this?

Best Answer

Basically adding the right username and password for the VD in Basic settings resolved this..