I am working on porting an \"ASP.NET Core Web Application\" that was compiling under the .NET Framework 4.6.1 (i.e. full framework) over to compiling against .NET Core 2.0.
I solved this problem installing the Nuget package:
Install-Package Microsoft.Windows.Compatibility
I was using ASP.net Core 2.2 but maybe works for 2.0v too
In Asp.Net Core, when the Microsoft WCF Web Service Reference Provider is used under the connected services, code generator automatically includes System.ServiceModel.Duplex, System.ServiceModel.Http, System.ServiceModel.NetTcp, System.ServiceModel.Security'assemblies.
<PackageReference Include="System.ServiceModel.Duplex" Version="4.4.*" />
<PackageReference Include="System.ServiceModel.Http" Version="4.4.*" />
<PackageReference Include="System.ServiceModel.NetTcp" Version="4.4.*" />
<PackageReference Include="System.ServiceModel.Security" Version="4.4.*" />
In your occasion, System.ServiceModel.Primitives is needed to be added aswell. System.ServiceModel.Primitives assembly includes System.ServiceModel.dll
System.ServiceModel, Version=4.0.0.0 is not used anymore.
please also see: https://github.com/dotnet/standard/issues/575#issuecomment-380479584