Server Error in '/' Application.

Could not find file 'D:\InetPub\vhosts\cosmic21-6220.package\gsttrainingbangalore.com\wwwroot\reviews\GstReviewList.txt'.

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.IO.FileNotFoundException: Could not find file 'D:\InetPub\vhosts\cosmic21-6220.package\gsttrainingbangalore.com\wwwroot\reviews\GstReviewList.txt'.

Source Error:


Line 38:     {
Line 39:         string body = string.Empty;
Line 40:         using (StreamReader reader = new StreamReader(Server.MapPath("~/reviews/GstReviewList.txt")))
Line 41:         {
Line 42:             body = reader.ReadToEnd();

Source File: d:\inetpub\vhosts\cosmic21-6220.package\gsttrainingbangalore.com\wwwroot\gst-reviews.aspx.cs    Line: 40

Stack Trace:


[FileNotFoundException: Could not find file 'D:\InetPub\vhosts\cosmic21-6220.package\gsttrainingbangalore.com\wwwroot\reviews\GstReviewList.txt'.]
   System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath) +311
   System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost) +1020
   System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost) +66
   System.IO.StreamReader..ctor(String path, Encoding encoding, Boolean detectEncodingFromByteOrderMarks, Int32 bufferSize, Boolean checkHost) +93
   System.IO.StreamReader..ctor(String path) +32
   gstreviews.PopulateBody(String imgsub, String name, String company, String description) in d:\inetpub\vhosts\cosmic21-6220.package\gsttrainingbangalore.com\wwwroot\gst-reviews.aspx.cs:40
   gstreviews.Page_Load(Object sender, EventArgs e) in d:\inetpub\vhosts\cosmic21-6220.package\gsttrainingbangalore.com\wwwroot\gst-reviews.aspx.cs:31
   System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +85
   System.Web.UI.Control.OnLoad(EventArgs e) +79
   System.Web.UI.Control.LoadRecursive() +130
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2848


Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.8.4700.0