You know that there are no much .Net hosting, so for testing porpuse is somethimes hard to find a way to preview your project.
This how to publish a .Net core app(also .Net applications, like mvc, etc) on Heroku
Requirements.
* an Account on Heroku(and download heroku-cli)
* A few knowledge of Docker(this is the approach to publish) download docker-tools for windows
* your .Net Core app(create a empty project .net core api if you don't have one)
Steps:
Create a Docker file at solution/project level:
content:
FROM microsoft/aspnetcore:2.0.5
WORKDIR /app
COPY . .
CMD ASPNETCORE_URLS=http://*:$PORT dotnet coolbox.sale.api.dll
Compile your project as Releaseon cmd go to your publish folder(usually: bin/Release/netcoreapp2.0/publish)
execute this steps
1. Login on heroku
heroku login
2. login in container
heroku container:login
3. publish api or
dotnet publish -c Release
4. Copy DOCKERFILE to publish directory
./bin/release/netcoreapp2.0/publish
**In publish directory**
5. build docker image
docker build -t coolboxsale-api .
6. tag the heroku target image
docker tag coolboxsale-api registry.heroku.com/coolboxsale-api/web
7. push changes
heroku container:push web --app coolboxsale-api
8. put online:
heroku container:release web --app coolboxsale-api
and voila!:
For republish
Steps 5,7,8