我问了一个单独的问题(现已删除),我认为实际问题是什么。
.NET Jitter 是否不能实际执行此循环:
Private Shared Sub CheckXmlValidity(ByVal textReader As System.IO.StreamReader)
Try
' Check for "interesting" xml documents.
Dim settings = New System.Xml.XmlReaderSettings()
settings.XmlResolver = Nothing
settings.MaxCharactersInDocument = 655360
' Successfully parse the file, otherwise an XmlException is to be thrown.
Dim reader = System.Xml.XmlReader.Create(textReader, settings)
Try
While reader.Read()
'Just checking.
End While
Finally
reader.Close()
End Try
Catch ex As Exception
Throw New HttpException(500, "Invalid Xml data", ex)
End Try
End Sub
我希望不完全是因为可能引发的异常的副作用,但我只是在检查......