This is a small proof-of-concept demonstrating .NET Core on cloud.gov.
It uses Entity Framework Core and MySQL for persistence.
These steps describe how to get the app running on your local machine.
- MySQL server (e.g., running on localhost). Add a database and database user for this app.
- .NET Core SDK (see global.json for specific version of SDK in use)
After cloning this repository to your local machine, create src/CoreSandbox/appsettings.Development.json
with the following content:
{
"DATABASE_URL": "mysql://USERNAME:PASSWORD@HOST:PORT/DATABASE"
}
Replace USERNAME
, PASSWORD
, HOST
, PORT
, and DATABASE
with the appropriate settings for the MySQL database you configured.
You should now be able to debug the application locally by running it from Visual Studio Code or Visual Studio 2017.
You can also run it from the command line:
Windows
setx ASPNETCORE_ENVIRONMENT Development
cd src\CoreSandbox
dotnet restore
dotnet run
Linux/macOS
cd src/CoreSandbox
dotnet restore
ASPNETCORE_ENVIRONMENT=Development dotnet run
- Create a MySQL relational database service instance for the app to use.
- Update
manifest.yml
with the new database service name. - Run
build.cmd
(Windows) orbuild.sh
(Linux/macOS) to create a self-contained deployment package. - Run
cf push
to push the package to cloud.gov.