0
我有一個XSD文件用於驗證XML。問題是我得到一個錯誤。當我在本地機器上運行代碼時,不會引發錯誤。但是,如果我在集成中運行代碼,則會引發錯誤。找不到路徑的一部分
Dim strSchemaPath As String = String.Empty
Dim xmlSettings As XmlReaderSettings = Nothing
Dim msStream As MemoryStream = Nothing
IsXMLValid = True
msStream = New MemoryStream(System.Text.ASCIIEncoding.UTF8.GetBytes(xmlRequest))
strSchemaPath = Path.Combine(System.AppDomain.CurrentDomain.BaseDirectory, "XSD\Input.xsd")
xmlSettings = New XmlReaderSettings()
xmlSettings.ValidationType = ValidationType.Schema
xmlSettings.Schemas.Add(Nothing, strSchemaPath)
什麼樣的錯誤? –
找不到路徑的一部分。 'D:\ ... \ XSD \ Input.xsd' –
站在原因,那麼文件/目錄在本地機器上存在(並且是可訪問的),而不是在出現錯誤的服務器上。 – David