I have a fairly standard .net core MVC application built on Visual Studio for Mac. I have published may simalar projects to Azure App Services.
I'm now trying to publish this MVC app to Google App Engine. It publishes and runs, but none of the static content from the wwwroot folder is accessible from the browser - all file paths return 404.
I've confirmed the files are being copied to the server. Via SSH I run sudo docker exec -it gaeapp /bin/bash
In the directory I land in, I see the following:
DnsClient.dll
Dockerfile
... (project dlls)
app.yaml
appsettings.json
bundleconfig.json
publish
runtimes
source-context.json
web.config
In the publish directory I see:
DnsClient.dll
... (project dlls)
app.yaml
appsettings.json
bundleconfig.json
runtimes
web.config
wwwroot
wwwroot contains all the files I expect. I've tried copying files out of wwwroot to various levels of the tree, but still cannot access the files.
Here's my app.yaml in case that helps:
runtime: aspnetcore
env: flex
# This sample incurs costs to run on the App Engine flexible environment.
# The settings below are to reduce costs during testing and are not appropriate
# for production use. For more information, see:
# https://cloud.google.com/appengine/docs/flexible/python/configuring-your-app-with-app-yaml
manual_scaling:
instances: 1
resources:
cpu: 1
memory_gb: 0.5
disk_size_gb: 10
env_variables:
# The __ in My__Greeting will be translated to a : by ASP.NET.
My__Greeting: Hello AppEngine!root@c2d2b26894e2:/app#
Any ideas how I might fix this?
More Info
In case there was an issue with my project, I created a new MVC project from the VS template and published this. Same issue, as shown in the screenshot below. Tried with default template, plus added app.UseDefaultFiles(); as suggested in an answer.
So, I assume the issue is in Google or the deployment...
