[Mono-dev] WebClient.DownloadFile doesn't work on Windows

Gonzalo Paniagua Javier gonzalo.mono at gmail.com
Sun Apr 26 11:11:39 EDT 2009


On Thu, 2009-04-23 at 12:38 +0200, Andoni Morales wrote:
> I'm trying to implement an updates notifier for my program. It
> downloads an XML file describing to latest version using
> "WebClient.DownloadFile" and compares the actual version number with
> the one installed
> (https://forja.rediris.es/plugins/scmsvn/viewcvs.php/LongoMatch/trunk/LongoMatch/Updates/Updater.cs?root=csl-longomatch&rev=637&view=markup).
> On Linux everything works fine, but on Windows I get the following
> exception:
> 
> System.Net.WebException: An error occurred performing a WebClient
> request. ---> System.NotSupportedException:
> http://www.ylatuya.es/updates/version.xml

That looks like a configuration problem. Perhaps mono is not finding
machine.config or the following lines are not there:

<webRequestModules>
<add prefix="http" type="System.Net.HttpRequestCreator, System,
Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<add prefix="https" type="System.Net.HttpRequestCreator, System,
Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<add prefix="file" type="System.Net.FileWebRequestCreator, System,
Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<add prefix="ftp" type="System.Net.FtpRequestCreator, System,
Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
</webRequestModules>

-Gonzalo





More information about the Mono-devel-list mailing list