Skip to content

gregz1/cdscntapimkpwebapp1

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

56 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

.NET Core Buildpack with Heroku Support

(Heroku Button with ASP.NET Core MVC Sample)

This uses the .Net Core Buildpack provided by Softtends

We've made some big updates in this release, so it’s important that you spend a few minutes to learn what’s new.

You've created a new ASP.NET Core MVC project. Learn what's new

You need to make the following changes in your Program.cs and project.json to deploy on Heroku
In Program.cs

  • Add UseUrls method and pass args[0] as parameter to start your app. Because Heroku web dyno will start with dynamic port after sucessful deployment. We need to use the same port in code behind also then only your app will start and listen on that port else dotnet runtime will set default port 5000. Thereby we pass port number as parameter with url in Procfile

public static void Main(string[] args {
var host = new WebHostBuilder() .UseKestrel() .UseContentRoot(Directory.GetCurrentDirectory()) .UseIISIntegration() .UseStartup() **.UseUrls(args[0])** .Build();
        host.Run();

}
In project.json

  • Add a new property called "outputName": "Your_ProjectName" in buildOptions
  • Remove scripts section. It has prepublish and postpublish actions which are not needed


You can deploy this ASP.Net MVC website on Heroku server by clicking below button

Deploy

This application consists of:

  • Sample pages using ASP.NET Core MVC
  • Gulp and Bower for managing client-side libraries
  • Theming using Bootstrap

How to

Overview

Run & Deploy

We would love to hear your feedback

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks