Reputation: 46651
When I create a WCF Service Library, an app.config is generated for me where I put the end points. Then if I create a website and reference the WCF Service Library, it creates a web.config file where I can specify the end points. Do I put the end points in the app.config or web.config or do they have to be in both?
Upvotes: 4
Views: 1551
Reputation: 10859
Essentially, it's Web.config
if you're hosting the services in IIS, app.config
if you're self hosting. So it sounds like you want to put them in the web.config
.
Full details can be found here where MSDN says:
When configuring a service in Visual Studio, use either a Web.config file or an App.config file to specify the settings. The choice of the configuration file name is determined by the hosting environment you choose for the service. If you are using IIS to host your service, use a Web.config file. If you are using any other hosting environment, use an App.config file.
In Visual Studio, the file named App.config is used to create the final configuration file. The final name actually used for the configuration depends on the assembly name. For example, an assembly named "Cohowinery.exe" has a final configuration file name of "Cohowinery.exe.config". However, you only need to modify the App.config file. Changes made to that file are automatically made to the final application configuration file at compile time.
Upvotes: 3