I'm having trouble figuring out the correct parameters to use when publishing an ASP.NET Core project that hosts a Blazor WebAssembly application via the dotnet publish command.
When I use the "Publish" button in Visual Studio, I get a self-contained, single-file published application, and everything works fine. However, when I try to achieve the same result using the dotnet publish command, I encounter errors.
Here's the command I'm using:
& "C:\Program Files\dotnet\dotnet.exe" publish D:\OrderStatus.Gui.Host\OrderStatus.Gui.Host.csproj
--configuration Release --framework net8.0
--output D:\output\ --self-contained True --verbosity Minimal
/property:PublishSingleFile=True /property:DebugType=None
/property:UseAppHost=True
When I include the UseAppHost=True property, I get the following error:
Error NETSDK1084: There is no application host available for the specified RuntimeIdentifier 'browser-wasm'
If I omit the UseAppHost property, I encounter this error instead:
Error NETSDK1098: Applications published to a single-file are required to use the application host. You must either set PublishSingleFile to false or set UseAppHost to true.
What am I doing wrong in the dotnet publish command configuration?
How can I achieve the same result as when using the Publish button in Visual Studio, but via the command line?
Any guidance would be greatly appreciated! Thank you in advance.

ASP.NET core Hosted Blazor WebAssembly Application? This blazor wasm project has Client+Shared+Server projects right? If so, you only need to publish the server project.dotnet publish D:\Orderxxxx.csproj --configuration Release --framework net7.0 --runtime win-x64 --output D:\output\ --self-contained true /property:PublishSingleFile=true /property:DebugType=noneand I followed this section