Coder Social home page Coder Social logo

dotnetcore-buildpack's Introduction

Heroku .NET Core Buildpack

This is the Heroku buildpack for ASP.NET Core.

Build status

Usage

The Buildpack will search through the repository's folders to locate a Startup.cs or Program.cs file. If found, the .csproj in the containing folder will be used in the dotnet publish <project>.csproj command.

If repository contains multiple Web Applications (multiple Startup.cs), PROJECT_FILE and PROJECT_NAME environment variables allow to choose project for publishing.

.NET Core latest stable

heroku buildpacks:set jincod/dotnetcore

.NET Core edge

heroku buildpacks:set https://github.com/jincod/dotnetcore-buildpack

Previous releases

heroku buildpacks:set https://github.com/jincod/dotnetcore-buildpack#version

Available releases

More info

Entity Framework Core Migrations

You cannot run migrations with the dotnet ef commands once the app is built. Alternatives include:

Enabling Automatic Migrations

  • Ensure the ASPNETCORE_ENVIRONMENT environment variable is set to Production. ASP.NET Core scaffolding tools may create files that explicitly set it to Development. Heroku config will override this (heroku config:set ASPNETCORE_ENVIRONMENT=Production).
  • Configure your app to automatically run migrations at startup by adding the following to the .csproj file:
<Target Name="PrePublishTarget" AfterTargets="Publish">
  <Exec Command="dotnet ef database update" />
</Target>
  • Configure your connection string string appropriately, for example, for PostgreSQL:

sslmode=Prefer;Trust Server Certificate=true

Manually Running Migration Scripts on the Database

  • Manually run SQL scripts generated by Entity Framework Core in your app's database. For example, use PG Admin to connect your Heroku Postgres service.

Node.js and NPM

heroku buildpacks:set jincod/dotnetcore
heroku buildpacks:add --index 1 heroku/nodejs

Using Multiple Buildpacks for an App

Example

ASP.NET Core Demo App

Donation

If this project help you, you can give me a cup of coffee โ˜•

Donate

dotnetcore-buildpack's People

Contributors

alexschrod avatar bbatha avatar dstj avatar evgenyt1 avatar friism avatar jayhelton avatar jincod avatar jkutner avatar mattwelke avatar soldag avatar wim-jan avatar xt449 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.