umbraco / Umbraco-CMS

Umbraco is a free and open source .NET content management system helping you deliver delightful digital experiences.
https://umbraco.com
MIT License
4.42k stars 2.66k forks source link

Not able to run minimal v11 site using published binaries #13429

Closed dlidstrom closed 1 year ago

dlidstrom commented 1 year ago

Which Umbraco version are you using? (Please write the exact version, example: 10.1.0)

11.0.0-rc4

Bug summary

When trying to run a minimal site after publishing nothing happens. I'm on Windows using dotnet 7.0.100.

Specifics

No response

Steps to reproduce

Here is the reproduce steps:

PS C:\> dotnet new install Umbraco.Templates::11.0.0-rc4
PS C:\> dotnet new umbraco -o UmbracoCms
The template "Umbraco Project" was created successfully.

Processing post-creation actions...
Restoring C:\UmbracoCms\UmbracoCms.csproj:
  Determining projects to restore...
  Restored C:\UmbracoCms\UmbracoCms.csproj (in 22,31 sec).
Restore succeeded.

PS C:\> cd .\UmbracoCms\
PS C:\UmbracoCms> dotnet publish -c Release -o out
MSBuild version 17.4.0+18d5aef85 for .NET
  Determining projects to restore...
  All projects are up-to-date for restore.
  UmbracoCms -> C:\UmbracoCms\bin\Release\net7.0\UmbracoCms.dll
  Copying appsettings-schema.json and appsettings-schema.Umbraco.Cms.json files
  UmbracoCms -> C:\UmbracoCms\out\
PS C:\UmbracoCms> dotnet .\out\UmbracoCms.dll

At this point nothing happens. Am I missing a step?

Expected result / actual result

I expect the site to start. Compare with running a vanilla mvc site:

PS C:> dotnet new mvc -o MvcTest
The template "ASP.NET Core Web App (Model-View-Controller)" was created successfully.
This template contains technologies from parties other than Microsoft, see https://aka.ms/aspnetcore/7.0-third-party-notices for details.

Processing post-creation actions...
Restoring C:\MvcTest\MvcTest.csproj:
  Determining projects to restore...
  Restored C:\MvcTest\MvcTest.csproj (in 129 ms).
Restore succeeded.

PS C:> cd .\MvcTest\
PS C:\MvcTest> dotnet publish -c Release -o out
MSBuild version 17.4.0+18d5aef85 for .NET
  Determining projects to restore...
  All projects are up-to-date for restore.
  MvcTest -> C:\MvcTest\bin\Release\net7.0\MvcTest.dll
  MvcTest -> C:\MvcTest\out\
PS C:\MvcTest> dotnet .\out\MvcTest.dll
info: Microsoft.Hosting.Lifetime[14]
      Now listening on: http://localhost:5000
info: Microsoft.Hosting.Lifetime[0]
      Application started. Press Ctrl+C to shut down.
info: Microsoft.Hosting.Lifetime[0]
      Hosting environment: Production
info: Microsoft.Hosting.Lifetime[0]
      Content root path: C:\MvcTest
dlidstrom commented 1 year ago

So it starts, it just doesn't log anything. And I noticed in another issue that a build might be necessary first.

Zeegaan commented 1 year ago

Hey @dlidstrom This is by design! We don't want to write to the console when not in debug mode.

You can change this default behavior by creating a appsettings.Production.json file and then adding a filesync like in the appsettings.Development.json file:

"Serilog": {
    "MinimumLevel": {
      "Default": "Information"
    },
    "WriteTo": [
      {
        "Name": "Async",
        "Args": {
          "configure": [
            {
              "Name": "Console"
            }
          ]
        }
      }
    ]
  },
dlidstrom commented 1 year ago

@Zeegaan Thanks for clarifying. I just noticed the same and now see output after duplicating the appsettings.Development.json file.