7

If I create a new ASP.NET Core Web API + Angular project in Visual Studio using: dotnet new angular, it creates a .NET 5 project containing in the ClientApp a new Angular 8.2 project.
If I F5 it, everything works perfectly.

But I want to use and Angular 11 project, so i wipe the ClientApp content, open a terminal there and: ng new <app-name> --directory ./ there.

Project created, F5, the project launches but at every launch these 2 lines appear in the Debug Console:

Microsoft.AspNetCore.SpaServices: Error: - Generating browser application bundles... Microsoft.AspNetCore.SpaServices: Error: √ Browser application bundle generation complete.

I did many attempts: merging values from previous tsconfig.json, from angular.json, launchSettings.json, but nothing solved it.
Instead, if I launch an ng serve from the ClientApp directory, it works without errors.

Is there some incompatibility between Visual Studio and Angular's CLI? Thank you all in advance!

5
  • Don't think there are any incompatibilities - but why did you just not upgrade the angular version in the project that was in there? When you created a new one - you lost all .NET integrations that were installed Commented Dec 27, 2020 at 12:33
  • So, the application runs despite the console output? If so, ignore those. That is how the SPA services cope with output from the CLI. I see them all the time with the applications where I have done the same thing you did. They are dev/build time messages. They will not effect anything after the application is built and deployed. Commented Dec 27, 2020 at 12:36
  • @fredrik: I didn't know there are integrations, I'm pretty new to web development. Anyways, I tried that path 2 times, and even though I follow strictly the official update procedure, the sequence is not straight and there are warnings and errors of modules incompatibilities, if I --force those steps the final project does not work Commented Dec 27, 2020 at 13:05
  • @R.Richards: good to know, but it's kinda annoying to have errors and need to ignore them, it creates confusion and may lead to inadvertedly ignore other error notifications, it's ugly and risky Commented Dec 27, 2020 at 13:07
  • You can always roll back to the version of the CLI that came with the template. Commented Dec 27, 2020 at 13:53

2 Answers 2

5

it is not an actual error. angular writes build progress messages in the stream which dotnet identifies as errors. you can suppress progress (and the fake fail messages) adding this key in angular.json:

"projects": {
"<PROJECT_NAME>": {
  "architect": {
    "build": {
      "options": {
        "progress": false
      }
    }
  }
}
}
Sign up to request clarification or add additional context in comments.

Comments

3

I get similar issues and even asked about it. However, as the replies suggest, it's a matter of Angular producing results that unintentionally look like errors to .NET - basically a case of sloppy coding.

While I recognize your pain and do share it with you, you'll need to accept that MS is a bit behind Angular latest stuff. You should definitely keep going with 11th (or whatever version is the latest), in my opinion.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.