We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

New HTMLDocument from text file fails under UWP Release configuration

Create a Visual Basic UWP project in Visual Studio.
In MainPage.xaml:

	<TextBlock x:Name="Value"/>

In MainPage.xaml.vb:

' https://go.microsoft.com/fwlink/?LinkId=402352&clcid=0x804 上介绍了“空白页”项模板

''' <summary>
''' 可用于自身或导航至 Frame 内部的空白页。
''' </summary>
Public NotInheritable Class MainPage
    Inherits Page

	Private Async Sub MainPage_Loaded(sender As Object, e As RoutedEventArgs) Handles Me.Loaded
		Dim HtmlDocument As New Aspose.Html.HTMLDocument(Await (Await Windows.Storage.StorageFile.GetFileFromApplicationUriAsync(New Uri("ms-appx:///HTML文档.html"))).OpenStreamForReadAsync, "http://wj.shtc.cn")
		Value.Text = DirectCast(HtmlDocument.GetElementById("__VIEWSTATE"), Aspose.Html.HTMLInputElement).Value
	End Sub
End Class

This code should find the input element with ID “__VIEWSTATE” from the HTML text file and show its value. However, it run successfully only under Debug configuration. Aspose can’t find the element under Release configuration.
Visual Studio version:
Microsoft Visual Studio Community 2022 (64 位) - Preview
版本 17.3.0 Preview 1.1
Reproduce.zip (30.8 KB)


We are working over your query and will get back to you soon.


We have logged this problem in our issue tracking system as HTMLNET-3866. You will be notified via this forum thread once this issue is resolved.

We apologize for your inconvenience.


Please use synchronous methods to get the desired output as shown below.

Dim HtmlDocument As New Aspose.Html.HTMLDocument((Windows.Storage.StorageFile.GetFileFromApplicationUriAsync(New Uri("ms-appx:///HTML文档.html"))
.GetResult(), "http://wj.shtc.cn")