“/s”应用程序中的服务器错误。

未能找到文件“F:\Web\NewSubWeb\subweb\xml\agent.xml”。

说明: 执行当前 Web 请求期间,出现未经处理的异常。请检查堆栈跟踪信息,以了解有关该错误以及代码中导致错误的出处的详细信息。

异常详细信息: System.IO.FileNotFoundException: 未能找到文件“F:\Web\NewSubWeb\subweb\xml\agent.xml”。

源错误:


行 460:        string file = p.Server.MapPath("/xml/agent.xml");
行 461:        System.Xml.XmlDocument xDocument = new System.Xml.XmlDocument();
行 462:        xDocument.Load(file);
行 463:        System.Xml.XmlNode xNode = null;
行 464:        xNode = xDocument.SelectSingleNode("root/agent [areaid='" + areaID + "']");

源文件: f:\Web\SubsiteV3\App_Code\CommonMethod.cs    行: 462

堆栈跟踪:


[FileNotFoundException: 未能找到文件“F:\Web\NewSubWeb\subweb\xml\agent.xml”。]
   System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath) +1346
   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) +1322
   System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize) +132
   System.Xml.XmlDownloadManager.GetStream(Uri uri, ICredentials credentials, IWebProxy proxy, RequestCachePolicy cachePolicy) +122
   System.Xml.XmlUrlResolver.GetEntity(Uri absoluteUri, String role, Type ofObjectToReturn) +89
   System.Xml.XmlTextReaderImpl.OpenUrlDelegate(Object xmlResolver) +74
   System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, Object userData) +0
   System.Threading.CompressedStack.Run(CompressedStack compressedStack, ContextCallback callback, Object state) +112
   System.Xml.XmlTextReaderImpl.OpenUrl() +426
   System.Xml.XmlTextReaderImpl.Read() +304
   System.Xml.XmlLoader.Load(XmlDocument doc, XmlReader reader, Boolean preserveWhitespace) +160
   System.Xml.XmlDocument.Load(XmlReader reader) +135
   System.Xml.XmlDocument.Load(String filename) +147
   CommonMethod.GetAgentID(Page p) in f:\Web\SubsiteV3\App_Code\CommonMethod.cs:462
   Include_Top.Page_Load(Object sender, EventArgs e) in f:\Web\SubsiteV3\Include\Top.ascx.cs:21
   System.Web.UI.Control.OnLoad(EventArgs e) +109
   System.Web.UI.Control.LoadRecursive() +68
   System.Web.UI.Control.LoadRecursive() +165
   System.Web.UI.Control.LoadRecursive() +165
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1436


版本信息: Microsoft .NET Framework 版本:4.0.30319; ASP.NET 版本:4.6.1586.0