1

How to inject Angular 15 App into a .NET Core 6 project?

  1. The Angular app exists in the same folder as the .NET Core 6
  • It exists at the same same level as controllers
  1. The Angular app was created separately

I am not familiar with the process and UseSpa keeps throwing an error in the Program.cs file. I installed the extension Microsoft.AspNetCore.SpaServices.Extensions for it.

I have also copied the index.html from the dist folder and placed it Layout.cshtml, but Angular component is still not running

2
  • Hi @Kuzhapuvan, what's the error message you get? How do you inject the existed angular application? Commented Mar 9, 2023 at 4:33
  • @Rena- I am new to this. I am trying to use the solution provided in this site: code-maze.com/how-to-publish-angular-with-aspnet. Please let me know your thoughts. Error only comes up when I use <app.UseSpaStaticFiles();>. Commented Mar 9, 2023 at 13:04

1 Answer 1

0

Figured it out! "ng build" was creating the project at a different location. When this process was mapped and files from index.html was correctly referenced, the issue was resolved,

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.