Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
202 views

Cannot Get Message in ASP - Net Core Angular 6

The document describes an issue where a user was getting "Cannot GET/" messages when adding code to an Angular project in Visual Studio, but the pages would load if files were saved. The solution was found by checking the Visual Studio Output window, which showed an error that a module import was missing. The key was that the Output window provided insight into the actual issue when other tools did not.

Uploaded by

hsuyip
Copyright
© © All Rights Reserved
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
202 views

Cannot Get Message in ASP - Net Core Angular 6

The document describes an issue where a user was getting "Cannot GET/" messages when adding code to an Angular project in Visual Studio, but the pages would load if files were saved. The solution was found by checking the Visual Studio Output window, which showed an error that a module import was missing. The key was that the Output window provided insight into the actual issue when other tools did not.

Uploaded by

hsuyip
Copyright
© © All Rights Reserved
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

question is :

I am using Visual Studio 2017 15.8.3 with .Net Core 2.1 and Angular 6. I used the
template to create the project and upgraded it from Angular 5 to 6. It ran as
expected. I removed the template code and added my own. As I added more code I
started getting the Cannot GET/ message; however, if I go into any .ts file and
save it, refresh the browser everything reloads and comes up as expected. No errors
ever show. I can't see any issues.

I have this in Startup

app.UseSpa(spa =>
{
// To learn more about options for serving an Angular SPA from ASP.NET
Core,
// see https://go.microsoft.com/fwlink/?linkid=864501

spa.Options.SourcePath = "ClientApp";

if (env.IsDevelopment())
{
spa.Options.StartupTimeout = new TimeSpan(0, 0, 360);
spa.UseAngularCliServer(npmScript: "start");
spa.UseProxyToSpaDevelopmentServer("https://localhost:4200");
}
});

answer is :

Ok so this is kind of embarrassing but I am leaving this here just in case someone
runs into the same problem and can't figure it out.

I had copied a bunch of code over from a prototype project and I left out a file
that wasn't obvious. How did I find it? The Output window in Visual Studio! None of
the other tools showed anything.

Microsoft.AspNetCore.SpaServices:Error: ERROR in src/app/models/user-


configuration.model.ts(1,36): error TS2307: Cannot find module './functional-
ability.model'.

So I guess the lesson here is this:

Cannot GET / seems to be telling you that something is missing

The Visual Studio Output window and Error List are your buddies in these, and many
other situations.

another asnwer is :

I was facing the same problem. you need to do a little thing. Just remove the
deleted components and declarations from app.module.ts

You might also like