Server Error in '/' Application.

Could not find file 'c:\inetpub\strategypageroot\wargames\cwir\index\2024.htm'.

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 'c:\inetpub\strategypageroot\wargames\cwir\index\2024.htm'.

Source Error:


Line 71:             
Line 72:             string year = YearIndex ?? DateTime.Now.Year.ToString();
Line 73:            contentLabel.Text = File.ReadAllText(WebConfigurationManager.AppSettings["PathPreFix"] + "wargames/cwir/index/" + year + ".htm", Encoding.GetEncoding("UTF-8"));
Line 74:             headLineLabel.Text = year;
Line 75:             content = new CwirContent();

Source File: C:\inetpub\StrategyPageRoot\Wargames\cwir\BoardWargames.cs    Line: 73

Stack Trace:


[FileNotFoundException: Could not find file 'c:\inetpub\strategypageroot\wargames\cwir\index\2024.htm'.]
   System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath) +1404
   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) +1242
   System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost) +146
   System.IO.StreamReader..ctor(String path, Encoding encoding, Boolean detectEncodingFromByteOrderMarks, Int32 bufferSize, Boolean checkHost) +177
   System.IO.File.InternalReadAllText(String path, Encoding encoding, Boolean checkHost) +86
   BoardWargames.display() in C:\inetpub\StrategyPageRoot\Wargames\cwir\BoardWargames.cs:73
   BoardWargames.OnPreRender(EventArgs e) in C:\inetpub\StrategyPageRoot\Wargames\cwir\BoardWargames.cs:32
   System.Web.UI.Control.PreRenderRecursiveInternal() +132
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3671


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