From Visual Studio 2022, I right-click on project and choose publish. When publishing to folder the files are there but it is missing a web.config
.
If I run the dotnet publish
command from command prompt like this:
dotnet publish MyProject.csproj -c Release
It also does not create the IIS assets.
I found I accidentally created my project using the ASP.NET Core Web API (native AOT) template which uses CreateSlimBuilder in the Program.cs file. This is made for AOT and has no support for IIS (which I need). So I switched back to the old CreateBuilder