大家好,我不是.net开发人员,我来自PHP,python背景,我不知道该如何处理。
尝试加载我们的某个网站时出现以下错误。请有人帮忙
[ArgumentException: Illegal characters in path.]
System.IO.Path.CheckInvalidPathChars(String path) +7491109
System.IO.Path.GetFileName(String path) +19
System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize) +16
System.Xml.XmlDownloadManager.GetStream(Uri uri, ICredentials credentials) +77
System.Xml.XmlUrlResolver.GetEntity(Uri absoluteUri, String role, Type ofObjectToReturn) +54
System.Xml.XmlTextReaderImpl.OpenUrlDelegate(Object xmlResolver) +74
System.Threading.CompressedStack.runTryCode(Object userData) +70
System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, Object userData) +0
System.Threading.CompressedStack.Run(CompressedStack compressedStack, ContextCallback callback, Object state) +108
System.Xml.XmlTextReaderImpl.OpenUrl() +186
System.Xml.XmlTextReaderImpl.Read() +208
System.Xml.XPath.XPathDocument.LoadFromReader(XmlReader reader, XmlSpace space) +217
System.Xml.XPath.XPathDocument..ctor(String uri, XmlSpace space) +116
System.Xml.XPath.XPathDocument..ctor(String uri) +6
OpenBay.Utils.XPathUtils.GetNodes(String xpathQuery, String xmlFile) +30
OpenBay.Wms.Controllers.SiteController.SetErrorPages(Site site) +21
OpenBay.Wms.Controllers.SiteController.GetSite(Uri uri, DirectoryInfo dir, String applicationName) +104
OpenBay.Wms.HttpModule.UrlProcessHttpModule.GetSiteParameters(HttpApplication app, RequestInfo info) +172
OpenBay.Wms.HttpModule.UrlProcessHttpModule.ProcessRequest(Object o, EventArgs args) +338
System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +68
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +75
thanks guys
答案 0 :(得分:3)
您的代码将调用System.IO.Path.CheckInvalidPathChars
,后者会检查以下内容:
双引号(“)
左尖括号(<)
直角括号(>)
veritical bar(|)
和小于32十进制(空格)的控制字符。
因此,请确保您的路径不包含它们。
我的问题是我的未转义\在c:\中使它成为c:\ fixed it
答案 1 :(得分:0)
Nice Stacktrace,但无效路径会更有帮助。
在我的oponion中,提供给OpenBay.Utils.XPathUtils.GetNodes(string,string)的路径有一些无效的参数。使用System.IO.Path.CheckInvalidPathChars()检查哪些字符无效,并且可能包含在上述方法提供的参数中。
答案 2 :(得分:0)