Visual Studio does not generate app.config content when "add service reference"

SAPNET picture SAPNET · Jan 29, 2010 · Viewed 23.7k times · Source

When I add a web service by using "add service reference" in the console app, the app.config does not generate the configuration. How do I generate this app.config with a specific wsdl? Thanks!

Answer

Carl Onager picture Carl Onager · Aug 20, 2012

When adding the service reference try clicking on the 'Advanced...' button and then uncheck the 'Reuse types in referenced assemblies' checkbox.

I found this out when I had created a simple project to test a third party service which all worked fine. Attempting to add the same reference to the main project resulted in the app.config and reference.vb file not being generated correctly.

I think this may have been because there were already other web references in the application or referenced applications, however unchecking 'Reuse types' resulted in the files being generated correctly.