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

前端 未结 5 1672
执念已碎
执念已碎 2020-12-09 01:45

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

5条回答
  •  旧巷少年郎
    2020-12-09 02:40

    (Same answer I gave at Visual Studio 2010: adding a service reference to a 2008 generated wsdl )


    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!

提交回复
热议问题