Share via

ASP.NET Compatibility

Retired Content

The Web Service Software Factory is now maintained by the community and can be found on the Service Factory site.

This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies.
This page may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.

Retired: November 2011

Another item to consider when migrating a service is the need to maintain compatibility with features that are provided by ASP.NET in the WCF service.

As discussed in Differences Between ASMX and WCF Services, some capabilities can be supported only when using the ASP.NET Compatibility mode. These capabilities include the following:

  • Security. With WCF, active control lists (ACLs) cannot be used to restrict access to the file system. In addition, WCF does not support the use of profiles introduced in ASP.NET 2.0.
  • State management. WCF provides limited support for state management. Maintaining state in a Web service is not recommended, but you may be migrating an application that depends on state that is managed by the HttpContext object.

Only services hosted in Internet Information Services (IIS), and which are configured with HTTP as the transport protocol, can be configured to use the WCF ASP.NET compatibility mode. Use the following procedure to turn on that option.

To configure WCF for ASP.NET compatibility mode

  1. Add the System.ServiceModel.Activation.AspNetCompatbilityRequirements attribute to the service type, specifying that ASP.NET compatibility mode is either allowed or required, as shown in the following code.
  2. Configure the application to use the ASP.NET compatibility mode.