system.web inside of app.config file with ClientAuthenticationMembershipProvider added by default
Asked Answered
P

2

22

I just upgraded my Windows Forms project from .NET 3.0 to .NET 3.5 and the upgrade added the following to my app.config file:

<system.web>
  <membership defaultProvider="ClientAuthenticationMembershipProvider">
    <providers>
      <add name="ClientAuthenticationMembershipProvider" type="System.Web.ClientServices.Providers.ClientFormsAuthenticationMembershipProvider, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" serviceUri=""/>
    </providers>
  </membership>
  <roleManager defaultProvider="ClientRoleProvider" enabled="true">
    <providers>
      <add name="ClientRoleProvider" type="System.Web.ClientServices.Providers.ClientRoleProvider, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" serviceUri="" cacheTimeout="86400"/>
    </providers>
  </roleManager>
</system.web>

I thought that system.web was only for Web projects. Does this seem wrong?

Pizor answered 5/8, 2009 at 3:59 Comment(0)
G
23

If you are not using the ASP.NET Membership features for authentication / authorization, these entries can be removed. The XML entry is just a reference to the assembly where the membership classes are found, as is not specific to windows / web applications. ASP.NET membership can be used for both types of applications.

Gown answered 5/8, 2009 at 4:24 Comment(2)
Do you know why this entry is added in an app.config and who is adding it?Xiphoid
These references are often auto-generated at the time a VS project is created. In the case of the question above, it was added when the project was upgraded to .net 3.5. In short, Visual Studio adds them automatically. They can be removed manually.Gown
F
0

When VS added the system.web stuff to my app.config(!) file, the RELEASE configuration of the program refused to compile, complaining about missing references not related to the membership stuff.

I have no idea why that would be.

Funky answered 23/10, 2019 at 17:24 Comment(1)
I should add that when I unchecked optimization, the release configuration compiled even with the weird config stuff in place.Funky

© 2022 - 2024 — McMap. All rights reserved.