Skip to content

Latest commit

 

History

History
 
 

dotnet6server

.NET 6 Core WCF Sample

This sample shows how to use Core WCF with .NET 6 using the Minimal API Syntax.

This sample uses the BasicHttpBinding and exposes EndPoints at http://localhost:5000/EchoService/basichttp and https://localhost:5001/EchoService/basichttp. The base url comes from the Urls property in appsettings.json, and the path from the EndPoint registration in code.

Bindings

The bindings can be changed via code, for example to use WSHttpBinding, the Endpoint can be changed to (or additionally exposed with):

    .AddServiceEndpoint<EchoService, IEchoService>(new WSHttpBinding(SecurityMode.Transport), "/EchoService/wshttp");

Nuget References

The project is configured to pull the CoreWCF binaries from Nuget.org. If you are building CoreWCF locally, change the project references to relative paths:

  <ItemGroup>
    <ProjectReference Include="..\..\CoreWCF.Http\src\CoreWCF.Http.csproj" />
    <ProjectReference Include="..\..\CoreWCF.Primitives\src\CoreWCF.Primitives.csproj" />
  </ItemGroup>