|
| 1 | +--- |
| 2 | +title: "Removal of WCF APIs with a `configurationName` parameter" |
| 3 | +description: Learn about the breaking change in .NET 8 where the WCF APIs that accept a `configurationName` parameter have been removed. |
| 4 | +ms.date: 11/13/2024 |
| 5 | +ai-usage: ai-assisted |
| 6 | +ms.custom: https://github.com/dotnet/docs/issues/43111 |
| 7 | +--- |
| 8 | + |
| 9 | +# Removal of WCF APIs with a `configurationName` parameter |
| 10 | + |
| 11 | +The WCF APIs that accept either a `configurationName` parameter or an `endpointConfigurationName` parameter have been removed in .NET 8. These APIs were previously used in .NET Framework to load client configuration parameters such as the `Binding` configuration and the `EndpointAddress` details. |
| 12 | + |
| 13 | +## Version introduced |
| 14 | + |
| 15 | +.NET 8 GA |
| 16 | + |
| 17 | +## Previous behavior |
| 18 | + |
| 19 | +The removed APIs were previously suppressed from IntelliSense suggestions. Using any of the removed APIs resulted in a <xref:System.PlatformNotSupportedException> being thrown. |
| 20 | + |
| 21 | +## New behavior |
| 22 | + |
| 23 | +The APIs no longer exist. If you upgrade to .NET 8 and recompile your code, it will fail. |
| 24 | + |
| 25 | +## Type of breaking change |
| 26 | + |
| 27 | +This change is a [binary incompatible](../categories.md#binary-incompatible) and [source incompatible](../categories.md#source-incompatible) change. |
| 28 | + |
| 29 | +## Reason for change |
| 30 | + |
| 31 | +These APIs were never implemented on .NET and any calls to these APIs previously resulted in a run-time exception. |
| 32 | + |
| 33 | +## Recommended action |
| 34 | + |
| 35 | +Remove any usage of these APIs. |
| 36 | + |
| 37 | +If you're using a WCF client generated by the `svcutil` utility from the .NET Framework SDK, the generated client will have constructors that call base class constructors that have been removed. The base class will be either <xref:System.ServiceModel.ClientBase`1> or <xref:System.ServiceModel.DuplexClientBase`1>. The generated constructors were unusable on .NET as they resulted in a `PlatformNotSupportedException` being thrown. |
| 38 | + |
| 39 | +- If you're multi-targeting .NET Framework and .NET and are still using these generated constructors on .NET Framework, you'll need to conditionally compile their usage. |
| 40 | +- If you're not using these constructors, you can delete them from the generated code. Alternatively, consider regenerating the client using `dotnet-svcutil`. |
| 41 | + |
| 42 | +## Affected APIs |
| 43 | + |
| 44 | +- <xref:System.ServiceModel.NetHttpBinding.%23ctor(System.String)> |
| 45 | +- <xref:System.ServiceModel.NetTcpBinding.%23ctor(System.String)> |
| 46 | +- <xref:System.ServiceModel.ChannelFactory.ApplyConfiguration(System.String)?displayProperty=fullName> |
| 47 | +- <xref:System.ServiceModel.ChannelFactory.InitializeEndpoint(System.String,System.ServiceModel.EndpointAddress)?displayProperty=fullName> |
| 48 | +- <xref:System.ServiceModel.ChannelFactory`1.%23ctor(System.String)> |
| 49 | +- <xref:System.ServiceModel.ChannelFactory`1.%23ctor(System.String,System.ServiceModel.EndpointAddress)><xref:System.ServiceModel.DuplexChannelFactory`1.%23ctor(System.ServiceModel.InstanceContext,System.String)> |
| 50 | +- <xref:System.ServiceModel.DuplexChannelFactory`1.%23ctor(System.ServiceModel.InstanceContext,System.String,System.ServiceModel.EndpointAddress)><xref:System.ServiceModel.DuplexClientBase`1.%23ctor(System.ServiceModel.InstanceContext,System.String)> |
| 51 | +- <xref:System.ServiceModel.DuplexClientBase`1.%23ctor(System.ServiceModel.InstanceContext,System.String,System.ServiceModel.EndpointAddress)> |
| 52 | +- <xref:System.ServiceModel.DuplexClientBase`1.%23ctor(System.ServiceModel.InstanceContext,System.String,System.String)> |
0 commit comments