/Movies not working
Hi. The app seems to start good. I can load http://localhost:61298 but not /movies. The page goes empty. In the application Insights there is a 404 error for the page as if the page wasn't build. Any idea?. Thank you.
Document Details
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
- ID: 6719f08e-3bd7-dc1a-71df-f2ef9fbca9d8
- Version Independent ID: 7096fdb3-612e-9e00-bd0b-8ea4886a09ce
- Content: Add a model to a Razor Pages app in ASP.NET Core
- Content Source: aspnetcore/tutorials/razor-pages/model.md
- Service: aspnet-core
- GitHub Login: @Rick-Anderson
- Microsoft Alias: riande
That can fail for countless reasons. Download the completed app and run it. Compare your app to the completed. Step through the debugger in each app to help you figure out what's wrong/missing/etc. I can tell you the app works. Let us know when you figure out what you did wrong.
If it's blank, it means your scaffolding step did not work. You might as well be putting http://localhost:61298/blahblahnonsense. You'll get the same result.
My advice:
- take a break
- open powershell
- make SURE you are in the same directory as your Program.cs file
- MAKE SURE you are running the project you think you are running. Sometimes when flying through these samples it gets shockingly easy to lose which project:tutorial you are on
The samples do work, I just verified it myself 5 minutes ago. Keep trying and as Rick says, start debugging. That's where you learn the most anyway.
i have found the solution while scaffolding the project, the scaffolding was unable to find the Movies folder. Change it to below. Use backslash instead of forward slash. Before excuting the below command, you may want to create a Movies folder first inside your Pages folder. I am using VS code.
dotnet aspnet-codegenerator razorpage -m Movie -dc RazorPagesMovieContext -udl -outDir Pages/Movies --referenceScriptLibraries