The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.
CorsHttpConfigurationExtensions.EnableCors Method
Namespace:
System.Web.Http
Assembly: System.Web.Http.Cors (in System.Web.Http.Cors.dll)
| Name | Description | |
|---|---|---|
![]() ![]() | EnableCors(HttpConfiguration) | Enables the support for CORS. |
![]() ![]() | EnableCors(HttpConfiguration, ICorsPolicyProvider) | Enables the support for CORS. |
CorsHttpConfigurationExtensions.EnableCors Method (HttpConfiguration)
Enables the support for CORS.
<ExtensionAttribute> Public Shared Sub EnableCors ( httpConfiguration As HttpConfiguration )
Parameters
- httpConfiguration
-
Type:
System.Web.Http.HttpConfiguration
The HttpConfiguration.
CorsHttpConfigurationExtensions.EnableCors Method (HttpConfiguration, ICorsPolicyProvider)
Enables the support for CORS.
<ExtensionAttribute> Public Shared Sub EnableCors ( httpConfiguration As HttpConfiguration, defaultPolicyProvider As ICorsPolicyProvider )
Parameters
- httpConfiguration
-
Type:
System.Web.Http.HttpConfiguration
The HttpConfiguration.
- defaultPolicyProvider
-
Type:
System.Web.Http.Cors.ICorsPolicyProvider
The default ICorsPolicyProvider.
| Exception | Condition |
|---|---|
| ArgumentNullException | httpConfiguration |
Show:

