Doesn't produce a app.config . In my team there is a guy who has Visual Studio 2008, he created a webservice开发者_如何学Python.
Then there is me, adding this webservice to a console project.
Adding the service reference goes without problems but no valid app.config is generated. It's just empty
<configuration>
</configuration>
When I disable 'reuse types' in my service reference it works but then I get an ambiguous error.
Is this a bug?
I found Visual Studio does not generate app.config content when "add service reference" this one, but there is no solution there, so I thought I bump the problem up again.
Thanks
This is the same answer as Visual Studio does not generate app.config content when "add service reference" duplicated to save cross referencing:
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.
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!
精彩评论