【发布时间】:2014-08-04 13:05:12
【问题描述】:
我添加了一个新网站和我尝试加载 Xml 的页面的 onLoad 事件
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
XmlDocument xmlDoc = new XmlDocument();
xmlDoc.Load(@"D:\languages\Lang-Ru.xml"); //ERROR
}
}
当我启动站点时,出现错误:
“System.NotSupportedException”类型的异常发生在 mscorlib.dll 但未在用户代码中处理
附加信息:不支持给定路径的格式
堆栈跟踪:
в System.Security.Util.StringExpressionSet.CanonicalizePath(String 路径,布尔需要FullPath) в System.Security.Util.StringExpressionSet.CreateListFromExpressions(String[] str, Boolean 需要FullPath) в System.Security.Permissions.FileIOPermission.AddPathList(FileIOPermissionAccess 访问, AccessControlActions 控件, String[] pathListOrig, Boolean checkForDuplicates, Boolean needFullPath, Boolean copyPathList) в System.IO.Path.GetFullPath(字符串路径) System.Xml.XmlResolver.ResolveUri(Uri baseUri, String relativeUri)
в System.Xml.XmlTextReaderImpl..ctor(String url, XmlNameTable nt) в System.Xml.XmlDocument.Load(字符串文件名) × _Default.Page_Load(Object sender, EventArgs e) в d:\sample\Default.aspx.cs:строка 14 в System.Web.UI.Control.LoadRecursive() System.Web.UI.Page.ProcessRequestMain(布尔值 includeStagesBeforeAsyncPoint,布尔型 includeStagesAfterAsyncPoint)
有人可以帮我吗?可能 IIS 中有一些非法设置。
【问题讨论】: