I am trying to deploy a sample .net8/Angular app that I created from the “Angular and ASP.Net Core” template provided by Visual Studio 2022 from GitLab to a CloudFoundry server.
However, I don’t think the template is configured correctly, for the dotnet publish
The template creates two projects: MyTest.Server and mytest.client.
In my gitlab-ci.yml I am trying to execute the following commands:
- dotnet restore ./*.sln
- dotnet build -c Release .*.sln
- dotnet publish MyTest.Server/MyTest.Server.csproj -c Release -o {$PWD}/publish
I see the client and server projects being built in the publish step
- ${PWD}/mytest.client/dist/mytest.client
- MyTest.Server -> ${PWD}/publish/
But, when I deploy this to Cloud Foundry, while the back-end server starts up, according to the logs, it does not appear to be hosting the Angular app, as I get a 404 error when connecting to the URL.
Example error: No webpage was found for the web address: https://mytest.my-cloud-foundry-server.com (HTTP ERROR 404)
When I run from Visual Studio, everything starts up as expected, back-end runs, front-end starts with ng serve browser starts up and displays the page, etc.
Other than going back to the older ASP.Net/Angular template that I’ve been using since .net 3.1, through .net 6… I’m not sure what to do and not having much luck searching yet.
I am thinking this may be because the angular client is being published to a dist folder, while the publish is using a wwwroot/browser folder… but I don’t see where that browser folder is being created…