Deploy .net core and angular in less than 5min. No vps setup

Written by 29x2 on Nov 15th, 2021 Views Report Post

Nowadays, web hosting companies for .net technologies are more and more rare, but with .net core technology, the problem is not getting any better. I have compiled a list of web hosting companies that support .net and .net core that I will share in another post but today I found smarterasp.net a platform that seems old fashioned but simple in approach and not at all expensive with a free plan (I am not sponsored).In less than 5 min I was able to deploy NGX.BILL an Angular & .net core application Here is quickly how I did it

Go to smarterasp.net and create your account. If you choose their free plan, you have to activate it on the dashboard by providing the requested info before doing anything

After activating it, click on this icon to access the control panel Image description

On the left you have your FTP connection information Image description

Create the database Click on database then mssql to create a new SQL Server database Image description

Get the connection string Image description

Install dotnet core 3.1 in your local machine: Download .net core 3.1

Use connection string provided in your appsettings.json (take into account your own project) to update the database in order to create the database with tables and default data.

Open a command prompt in the api root folder and navigate to your api project root

If you have a entity framework migrations execute them. this will create database, generate tables and default data inside the database.

dotnet ef database update 

Run the command below to create the deployment release

dotnet publish --configuration Release

You release will be at this path : your_dotnet_core_project\bin\Release\netcoreapp3.1\publish

In your_angular_project/src/environments/environment.prod.ts replace the value of with what will be your domain url

apiHost: 'http://yourdomain.com/api',

Download an install in your local machine the latest node.js: Link After nodejs installation, run the command below to install angular cli locally in your machine

npm install -g @angular/cli

Navigate to the angular root project:

npm install

Once the installation completed, In the same path, run the command below to generate the release

npm run prod

This will generate the release at this path: you_angular_project\dist\your_angular_project\

Use an FTP File transfert client or download WinSCP to connect to the server: https://winscp.net/eng/download.php

Upload the content of your api your_dotnet_core_project\bin\Release\netcoreapp3.1\publish to the server and then the content of the client in the dist folder inside the wwwroot folder of your api on the server.

That's all. Use the url provided to test your site then connect your domain name.

Hope this will help!

For more see: http://blog.twenty-ninex2.com/

Comments (0)