Dotnet run no longer shows port info, but backoffice works on port 5001

Previously, running dotnet run in my Umbraco project displayed the active port (e.g., “Now listening on: https://localhost:5001”).
Now it only shows warnings (like “: warning NU1902: Package ‘Umbraco.Cms’ 13.5.0 has a known moderate severity vulnerability, Umbraco Makes User Enumeration Feasible Based on Timing of Login Response · CVE-2025-46736 · GitHub Advisory Database · GitHub”).

The backoffice remains accessible at the port I configured in Program.cs (5001), but the lack of console output is confusing.

Environment:

  • Umbraco 13
  • .NET 7/8
  • Running via dotnet run (no Docker)

Has anyone encountered this?

I had this issue at some point. I had to manually add writeTo → console to my serilog entry in appsettings.

 "Serilog": {
    "WriteTo": [
      {
        "Name": "Console"
      }
    ],
    "MinimumLevel": {
      "Default": "Information"
    }
  }
1 Like

I tried that but without success!

When the environment is not set to development then this information is not displayed in the console.

Have you perhaps set an environment variable for the dotnet environment in your terminal recently that may have changed it?

I would check your launchsettings.json found at Properties/launchSettings.json

{
  "$schema": "https://json.schemastore.org/launchsettings.json",
  "iisSettings": {
    "windowsAuthentication": false,
    "anonymousAuthentication": true,
    "iisExpress": {
      "applicationUrl": "http://localhost:17082",
      "sslPort": 44391
    }
  },
  "profiles": {
    "IIS Express": {
      "commandName": "IISExpress",
      "launchBrowser": true,
      "environmentVariables": {
        "ASPNETCORE_ENVIRONMENT": "Development"
      }
    },
    "Umbraco.Web.UI": {
      "commandName": "Project",
      "dotnetRunMessages": true,
      "launchBrowser": true,
      "applicationUrl": "https://localhost:44391;http://localhost:17082",
      "environmentVariables": {
        "ASPNETCORE_ENVIRONMENT": "Development"
      }      
    }
  }
}

The important thing is that the ASPNETCORE_ENVIRONMENT is set to Development

Another way to verify if this is the problem is to pass the environment switch on the CLI itself.
dotnet run --environment=Development and then if you try with dotnet run --environment=Production you can see there are no logs typically output to the console unless you configured it to do so explicitly.

I run it using dotnet run --environment=Development but without success!

Here is the json:

{
  "$schema": "https://json.schemastore.org/launchsettings.json",
  "iisSettings": {
    "windowsAuthentication": false,
    "anonymousAuthentication": true,
    "iisExpress": {
      "applicationUrl": "http://localhost:11934",
      "sslPort": 44325
    }
  },
  "profiles": {
    "IIS Express": {
      "commandName": "IISExpress",
      "launchBrowser": true,
      "environmentVariables": {
        "ASPNETCORE_ENVIRONMENT": "Development"
      }
    },
    "Umbraco.Web.UI": {
      "commandName": "Project",
      "dotnetRunMessages": true,
      "launchBrowser": true,
      "applicationUrl": "https://localhost:44325;http://localhost:11934",
      "environmentVariables": {
        "ASPNETCORE_ENVIRONMENT": "Development"
      }      
    }
  }
}

OK so with this you are still not seeing anything output to the terminal, then my next thing would be to check your appsettings.json and appsettings.development.json to see if you have a logger configured to output to the terminal.

My first thing to go and check/test would be to try a brand new Umbraco install with
dotnet new umbraco --name Testing

If you run a new project does it also have the same problem, if so then it seems it would be machine/environment specific.

However if it does work, then it would point to me that its something specific to your project files and configuration and I would then check and verify the appsettings files.

Remember appsettings.development.json overrides what is in appsettings.json

Here is a default appsettings.development.json where it is using Serilog to write out to the console wrapped with an async Serilog output.

Default appsettings.development.json

{
  "$schema": "appsettings-schema.json",
  "Serilog": {
    "MinimumLevel": {
      "Default": "Information"
    },
    "WriteTo": [
      {
        "Name": "Async",
        "Args": {
          "configure": [
            {
              "Name": "Console"
            }
          ]
        }
      }
    ]
  },
  "Umbraco": {
    "CMS": {
      "Content": {
        "MacroErrors": "Throw"
      },
      "Hosting": {
        "Debug": true
      }
    }
  }
}

The same suggestion as provided by @krebil but yours was the fix which includes name and args!

Thanks, @warren.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.