Purpose of ClientSettingsProvider.ServiceUri in app.config

.NetWcf

.Net Problem Overview


What does

<appSettings>
    <add key="ClientSettingsProvider.ServiceUri" value=""/>
</appSettings>

do?

Since the value is empty string, can I remove the element?

.Net Solutions


Solution 1 - .Net

This has to do with ASP/Ajax Client Application Services (http://msdn.microsoft.com/en-us/library/bb384297(v=vs.100).aspx)

I too encountered this code in my app.config file and was confused since I've developed our entire application from scratch, and didn't add this.

What I discovered was that this line (and others under the tags) are added automatically to a project's app.config file when the "Enable client application services" checkbox is checked. It turned out mine was, though I still have no idea why or how this happened.

To see if this option is selected in your project(s), right click on a project and select "Properties". Navigate to the "Services" tab and see if the checkbox is checked. If it is, uncheck it, and the XML you're seeing should disappear from your app.config file.

IMPORTANT! - It seems there is a bug in VS2010 (and possibly other versions for all I know) where if you navigate to the "Services" tab, it will automatically check this box for you, adding the errant XML to your app.config file. So once you unckeck the box and save your project, navigate to a different tab in the properties section before closing it. You will also get an unnecessary reference to "System.Web.Extensions" added to your project. If you aren't using this for something else, you can remove it.

Solution 2 - .Net

it is used by ClientFormsAuthenticationMembershipProvider.

You can remove it if you do not use that model but it should be there if you use it even if it is empty.

Check my answer here - https://stackoverflow.com/questions/11173556/asp-net-membership-authentication-through-service/11189576#11189576

Solution 3 - .Net

Is the setting referenced anywhere in your code?

If not, you can probably remove it. If it is, only you can determine what the impact of removing it may be.

Please note that this could be used be a third party assembly and it may still look for it and throw an exception if it does not exist. This would be simple to spot (your application will fall over)

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionlinquizeView Question on Stackoverflow
Solution 1 - .NetZachView Answer on Stackoverflow
Solution 2 - .NetDmitry HarnitskiView Answer on Stackoverflow
Solution 3 - .NetChrisBintView Answer on Stackoverflow