I am trying to download the content of a XML file stored at a specific web address. bellow is the code
WebClient wc = new WebClient();
string data=wc.DownloadString(ghxuri);
XElement xml = XElement.Parse(data);
ghxuri is the link to download the file which has the following format http://path/xml_file
.
I am able to download the file by clicking the link and can also run it from my c# project. But when I am trying to execute the same function using a webgl build its throwing the following error
NullReferenceException: Object reference not set to an instance of an object.
Rethrow as WebException: An exception occurred during a WebClient request. at System.Net.WebClient.DownloadDataInternal (System.Uri address, System.Net.WebRequest& request) [0x00000] in <00000000000000000000000000000000>:0
(Filename: currently not available on il2cpp Line: -1)
I am not able to understand the nullreferenceexception reason.