Question

Currently, I have a service running on my Mac written in C# located in usr/local/program. This service is capable of detecting when it needs updates by checking the version number against a server version number. The update method is run, however there always is an exception when it tries to download the update.xml file that contains the information and what files to download. Here is the exception that we have gotten from our custom logger:

11:09:46 AM [Debug] Exception Type: WebException
11:09:46 AM [Debug] Stack Trace for above:
  at System.Net.WebClient.DownloadFile (System.Uri address, System.String fileName) [0x00000] in <filename unknown>:0 
  at System.Net.WebClient.DownloadFile (System.String address, System.String fileName) [0x00000] in <filename unknown>:0 
  at (wrapper remoting-invoke-with-check) System.Net.WebClient:DownloadFile (string,string)
  at dabler.Client.ClientService.tryUpdate () [0x00000] in <filename unknown>:0 
11:09:46 AM [Debug] System.NotSupportedException: http://www.website.com/updates/client/update.xml
  at System.Net.WebRequest.GetCreator (System.String prefix) [0x00000] in <filename unknown>:0 
  at System.Net.WebRequest.Create (System.Uri requestUri) [0x00000] in <filename unknown>:0 
  at System.Net.WebClient.GetWebRequest (System.Uri address) [0x00000] in <filename unknown>:0 
  at System.Net.WebClient.SetupRequest (System.Uri uri) [0x00000] in <filename unknown>:0 
  at System.Net.WebClient.DownloadFileCore (System.Uri address, System.String fileName, System.Object userToken) [0x00000] in <filename unknown>:0 
  at System.Net.WebClient.DownloadFile (System.Uri address, System.String fileName) [0x00000] in <filename unknown>:0 

I have researched this and according to the documentation I found, the NotSupportedException means that "The method has been called simultaneously on multiple threads." However, this is the first time that the service has ever even attempted to download a file, so I don't understand how this would be happening. One possibility I thought of would be the fact that it is trying to download the file to usr/local/program/update.xml but I gave the program root access to that folder.

Was it helpful?

Solution

Figured it out. The reason it wasn't working is because the program was built using 3.2.6 and I was trying to run it on a machine with 3.4.0. There doesn't seem to be any differences that I could tell between WebRequest.cs, but the building in a lower version was definitely the issue.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top