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!
views:
433answers:
2I wanted to post this as a comment on your question but I can't see how... I have exactly the same problem adding a reference to a JSON WCF service from a console app. This is in VS 2010. I add the service reference, and I can see it in intellisense, and it compiles OK, but the app.config remains empty, so when I run it it throws the same error as you. Did you manange to resolve it? Or did you have to create all that configuration crap by hand? Thanks.
(Same answer I gave at http://stackoverflow.com/questions/3022586/visual-studio-2010-adding-a-service-reference-to-a-2008-generated-wsdl/3113768#3113768 )
I have experienced the same issue with Visual Studio 2008. I find I get different results if I'm using the "Add Service Reference..." command, or digging deeper to "Add Service Reference..." | "Advanced..." | "Add Web Reference...".
However, the tried-and-true method--and the solution that worked for me--is still via the command line:
svcutil.exe /language:cs /out:GeneratedProxy.cs /config:app.config http://server/path_to/WebServiceBean?WSDL
That should give you a working app.config. Hope that helps!