This uses the .Net Core Buildpack provided by Softtrends
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 MySQL 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 MySQL website on Heroku server by clicking below button
- Sample pages using ASP.NET Core MySQL
- Gulp and Bower for managing client-side libraries
- Theming using Bootstrap
- Add a Controller and View
- Add an appsetting in config and access it in app.
- Manage User Secrets using Secret Manager.
- Use logging to log a message.
- Add packages using NuGet.
- Add client packages using Bower.
- Target development, staging or production environment.
- Conceptual overview of what is ASP.NET Core
- Fundamentals of ASP.NET Core such as Startup and middleware.
- Working with Data
- Security
- Client side development
- Develop on different platforms
- Read more on the documentation site
We would love to hear your feedback