Can Visual Studio restore WCF Web.config file with default setting?
When you create a new service in a WCF service project, Visual Studio automatically places configuration information in the service web.config file. Is there a way to reproduce this behavior using a new web config file and an existing service class in the service project? Sometimes the web.config service seems to be garbled, either through user error or visual studio specifics. It would be nice to remove the web.config service and get a new one that is automatically configured using the same default configuration as if the new service class were created in VS.
Is there a way to accomplish this?
EDIT: I mean the web.config file of the service, not the client web.config / app.config.
a source to share
Of course - you can run the command line utility svcutil.exe
for your service (directly using the URL or WSDL as the file). By default, a configuration file will be created output.config
containing all the necessary settings in the section <system.serviceModel>
. Just copy and paste into your new or existing web.config.
Mark
EDIT: From the comments below, there is no answer in the case of server side configuration.
a source to share