VS2010: Failed to generate code for the service reference

It is when I add a service reference but VS2010 did not update the app.config file. The file is created, but it only contains:

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
</configuration>

Yes, you can call it a blank app.config. I have no error in my project, and this is what I do to solve the problem:

  1. Delete the current (failed) created service reference
  2. Add a new service reference (no problem if you want to use the same name as previous reference name)
  3. After you add the address and reference name, click on Advanced…
  4. Un-check the Reuse types in referenced assemblies
  5. Done

I don’t know if this will work for you, but I think this worth a try.

Leave a comment

Tony Wijaya

My programming tips