Update .asf.yaml
1 file changed
tree: 17a741768e0ac4a547f831a1f4faab5ad930ed29
  1. .github/
  2. client/
  3. examples/
  4. .asf.yaml
  5. .editorconfig
  6. .gitignore
  7. .licenserc.yaml
  9. global.json
  11. NOTICE
  12. README.md
  13. ShenyuClient.sln

Shenyu .NET client

Getting Started

ASP.NET Core project

For ASP.NET Core project, we can refer to the example code at examples/AspNetCoreExample. What you need to do is quite simple and straightforward.

  1. add the Shenyu ASP.NET Core dependency into project.
dotnet add package <todo>
  1. in Startup.ConfigureServices method, add the ShenyuRegister service.
public void ConfigureServices(IServiceCollection services)
  1. set your Shenyu configurations in appsettings.json.
    "Shenyu": {
        "Register": {
            "ServerList": "http://localhost:9095",
            "Props": {
              "UserName": "<your_admin_user>",
              "Password": "<your_admin_password>"
        "Client": {
            "AppName": "dotnet-example",
            "ContextPath": "/dotnet",
            "IsFull": false,
            "ClientType": "http"
  1. enable calling via ip.

When running on your local machine, ASP.NET Core service can only be called from localhost. To enable calling by IP, you can replace https://localhost:{port};http://localhost:{port} with https://*:{port};http://*:{port} by one of the following ways.

  • Setting in launchSettings.json. Replace for applicationUrl field.
  • Setting by environment variables ASPNETCORE_URLS. e.g. ASPNETCORE_URLS "http://*:5000"
  • Adding --urls when start. e.g. dotnet run --urls "https://*:5001;http://*:5000"
  • Setting progratically by UseUrls() in Program.cs.


public static IHostBuilder CreateHostBuilder(string[] args) =>
            .ConfigureWebHostDefaults(webBuilder =>
                webBuilder.UseUrls("http://*:5000", "https://*:5001");

That's all! After finished above steps, you can just start your project and you can visit shenyu-admin portal to see the APIs have been registered in Shenyu.