I am upgrading a 3.1 .net core web api project to .net core 6. The project has a binding to a WCF service. Before it worked fine with 4.0x version of System.ServiceModel.*. But after upgrade, I am getting the below error.
Could not load file or assembly 'System.ServiceModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'. The system cannot find the file specified.
I added AutoGenerateBindingRedirects to the project as below.
<PropertyGroup>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<GenerateBindingRedirectsOutputType>true</GenerateBindingRedirectsOutputType>
</PropertyGroup>
But that didn't fix the problem. Any suggestions?