Question

I have several WCF services (.net 4.0) hosted through IIS on my web server. These services are consumed by my winforms client application (vb.net 4.0). Everything is working fine on my test machines (one XP, one Win7, and one Win8.1). I have deployed my app to my clients with this new functionality implemented, and everything has been going fine for the first 100 or so computers that my clients have installed it on.

I had one client today that was getting this error. Here is the full error just for reference:

Could not find default endpoint element that references contract 'NetworkTimeCheck.INetworkTimeCheck' in the ServiceModel client configuration section. This might be because no configuration file was found for your application, or because no endpoint element matching this contract could be found in the client element.

I remoted in to his machine and found that the <appname>.exe.config file was old (from a past version), and the msi installer had not overwritten the old config with the new one. I'm not sure why that happened on this particular machine (it has overwritten in all previous installs on other machines). Regardless, I was able to easily enough solve that issue by uninstalling and reinstalling the application. I chalked it up as a freak occurrence and moved on.

I have a second client that has three laptops running Win7 and he is getting the exact same error (his other three machines he has no error and everything works as it should!). I remoted in to one of his problem machines, and found that the <appname>.exe.config file WAS up to date and did contain the <system.serviceModel> section as it should. I have uninstalled/reinstalled with no success. I also updated my service references in Visual Studio just for giggles and installed a new build on his machine... Still no joy...

I am sure that my application is able to access the <appname>.exe.config file on these problem machines as I have the help namespace set in the <applicationSettings> section and the application has no problem opening up the help file.

So, my question is, why am I getting this error!?

PS I am considering manually configuring the endpoints and bindings at runtime from within the code, but that is my last resort. I really want to know why this is giving me fits on just a few client machines, while working fine everywhere else.

Thanks for your time!

Was it helpful?

Solution

Problem SOLVED.

Issue was Win7 had for some reason installed a previous version my app (a long time ago) in "Compatibility Mode", which leaves and old version of the <appname>.exe.config file in a hidden location, and Win7 continues to hang on to that old file even if a new version is installed.

I went to the application root directory on the client machine, clicked the "Compatibility Files" button, and deleted the old <appname>.exe.config, and walla!

Reference for more info: https://stackoverflow.com/a/8471259/2949093

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