When you use No-touch deployment, reading your config file might cause some problems.
I experienced this when I received a ‘No message was deserialized prior to calling the DispatchChannelSink’ error last week. It took me quite some time before I found the problem, because of the strange error. After a while I thought about the way my app was starting: I started a separate thread which configured a remoting interface based on the config file: RemotingConfiguration.Configure(). This because of the non-standard binary formatter that was used. The thread didn’t throw an exception (I know, bad programming, but it was a proof-of-concept 😉 ) and so the app tried to communicate with the remoted object….. which resulted in the error above.
Adding a try..catch to the code in my thread gave me the next error: ‘.Config file http://domain/app.exe.config can not be read successfully due to exception System.ArgumentException: URI formats are not supported’. This was a decent error and challenged me to solve it. That didn’t take too long 😉
The steps I coded to tackle this problem:
1. Try reading the config file from the current location
2. If an exception occurs, download the file to the ApplicationData folder (make an app-specific folder for it)
3. Read the file from the downloadlocation
The code I wrote for this is on my other computer. If someone’s interested: let me know.