Base solution for your next web application
Open Closed

How to change Port for ASPNET Core (Server) and Angular (Client) projects #9895


User avatar
0
fawad29 created

What is your product version? 10 Latest What is your product type (Angular or MVC)? ASP.net Core and Angular What is product framework type (.net framework or .net core)? .NET5 What is ABP Framework version? The one that comes up with ASP.NET and Angular v10.

What is the best way for changing ports for ASPNET Core Server project and Angular Project in the development environment? The ports 44301 (Server project) and 4200 (Angular Project) appears in multiple places. I tried to change them in all locations but I receive the errors displayed in the image below.

Can you help?


3 Answer(s)
  • User Avatar
    0
    fawad29 created

    I upgraded to the latest node version 14.15.1 and the error has disappeared.

    Could you still confirm the correct way for changing port number (in case I am overdoing the changes) as I am sharing a remote desktop environment with a colleague and we both needs to run the system at the same time so we can't use the same port?

  • User Avatar
    0
    zony created
    Support Team

    Hi learner29, You need to make the following changes, here I take 50001 and 50002 as examples: Server side (50001):

    1. Change all 44301 ports in the launchSettings.json file to target ports (50001).
    2. Change all 44301 ports in the appsettings.json file to target ports (50001).
    3. Change the appconfig.json file and appconfig.production.json of the Angular project, and change the 44301 port to the target port (50001).

    Client side (50002):

    1. Change all 4200 ports in the appsettings.json file to the target port (50002).
    2. Change the appconfig.json file and appconfig.production.json of the Angular project, and change port 4200 to the target port (50002).
    3. Change the angular.json file of the Angular project and change port 4200 to the target port (50002).
    4. Change the protractor.conf.js file of the Angular project and change port 4200 to the target port (50002).
    5. Change the package.json file of the Angular project and change port 4200 to the target port (50002).

    Snapshot:

  • User Avatar
    0
    fawad29 created

    Thank you