| Home » Categories » Multiple Categories |
How to Deploy and host .Net Core 2 and Angular 6 app |
|
Article Number: 316 | Rating: 4.2/5 from 5 votes | Last Updated: Wed, Sep 24, 2025 at 12:07 AM
|
| Normally, you will have two separate projects, i.e. one for .NET Core Web API 2.0 and the other one is Angular 6. On our Windows environment, you will find a root folder called httpdocs.
Problem: If you simply deploy the contents of the folder inside dist to the root folder httpdocs on server, there will be an error message, which states that "it cannot find any page", but the API still works.
If you transfer the whole folder inside httpdocs and set server Host setting to define document root to the folder:
![]() It will find the index.html and show me my landing page. However then API won't work.
If you leave it as is and change the document root back to httpdocs ( where the API files are ), but push the index.html from httpdocs/website to httpdocs ( in this case I also edit index.html to point to website folder for resources etc ) in the hope it will find it ( server IIS setting ) ![]() Solution:
1) Please add 2 lines of code in Configure method of Startup.cs in the API
app.UseDefaultFiles();
app.UseStaticFiles(); // For the wwwroot folder
Where according to MSDN, "With UseDefaultFiles, requests to a folder search for: index.html"
2) Please manually add wwwroot folder which for some reason was not generating upon publishing command for your API project.
3) In that folder, please copy all contents of my dist/website angular publish files
Now, it should work fine. If there is any issue, please ensure you raise a ticket via our Help Desk System. |
Attachments
There are no attachments for this article.
|
How to Solve the error: "405 - HTTP verb used to access this page is not allowed"?
Viewed 5531 times since Wed, Oct 24, 2018
I cannot find a way to enable ASP.NET 4.5 on my Control Panel
Viewed 11187 times since Tue, Sep 11, 2012
I am unable to renew my Let’s Encrypt SSL
Viewed 2678 times since Thu, Aug 23, 2018
Do I need a static IP?
Viewed 5101 times since Mon, May 7, 2012
Do you allow custom COM components?
Viewed 3063 times since Tue, May 1, 2012
I get an error Server.CreateObject Failed when I try to use CDONTs. What can I do?
Viewed 3109 times since Tue, May 1, 2012
Sample Code to Send email using ASP.NET 2
Viewed 9900 times since Tue, May 1, 2012
My application pool stops working. What is wrong with my site?
Viewed 13448 times since Sun, Feb 15, 2015
Will my Crystal Report X (Crystal Report 10) work on your server?
Viewed 2849 times since Tue, May 1, 2012
Sample Code to Send email using ASP.NET1.1
Viewed 5629 times since Tue, May 1, 2012
|


