C
C#•11mo ago
Masta

Asp.NET MVC Project not loading when starting up

Hello i've been working on this project that its pretty simple its about .NET APP that allow me to create, delete, edit, and see detail of many students. Days ago my project was starting up just fine and right now for some reason it appears the next error "Cannot find this localhost pageNo web page found for the web address: https://localhost:7072/ HTTP ERROR 404" There's a screenshot of my Program.cs for reference too can somebody help me please
No description
No description
43 Replies
Mayor McCheese
Mayor McCheese•11mo ago
What controllers do you have? 404 in this case means no index page was found
Masta
MastaOP•11mo ago
I have one controller its the StudentController
Masta
MastaOP•11mo ago
the index controller part is right here
No description
Masta
MastaOP•11mo ago
@model IEnumerable<Students.SchoolDB.Person> @{ ViewData["Title"] = "Index"; } <h1>Index</h1> <p> <a asp-action="Create">Create New</a> </p> <table class="table"> <thead> <tr> <th> @Html.DisplayNameFor(model => model. FirstName) </th> <th> @Html.DisplayNameFor(model => model.LastName) </th> <th> @Html.DisplayNameFor(model => model.DateOfBirth) </th> <th></th> </tr> </thead> <tbody> @foreach (var item in Model) { <tr> <td> @Html.DisplayFor(modelItem => item.FirstName) </td> <td> @Html.DisplayFor(modelItem => item.LastName) </td> <td> @Html.DisplayFor(modelItem => item.DateOfBirth) </td> <td> <a asp-action="Edit" asp-route-id="@item.Id">Edit</a> | <a asp-action="Details" asp-route-id="@item.Id">Details</a> | <a asp-action="Delete" asp-route-id="@item.Id">Delete</a> </td> </tr> } </tbody> this is my view i don't know if it helps but in the console inside of localhost:7072 is also empty with any errors when i check it
Gramore
Gramore•11mo ago
Do you still have a Home controller for that Home/Error redirect in your Program.cs?
Unknown User
Unknown User•11mo ago
Message Not Public
Sign In & Join Server To View
Masta
MastaOP•11mo ago
I dont have it anymore This is a database that im using from MSql
Gramore
Gramore•11mo ago
Mby add it back and see if that fixes your 404 🙂
Unknown User
Unknown User•11mo ago
Message Not Public
Sign In & Join Server To View
Gramore
Gramore•11mo ago
ye learning to love DI is a whole step in the learning process
Masta
MastaOP•11mo ago
Ill try look into it better i was just trying to solve the issue with the startup of the project cuz it doesnt even load Update i have add a HomeController to see if it would at least receive something and it appears the same i also tried changing the "Home/Error" to " Student/Error" and it loads and appears the same error Cannot find this localhost pageNo web page found for the web address: https://localhost:7072/ HTTP ERROR 404 it didnt work
Gramore
Gramore•11mo ago
Then nothing obvious sticks out, next step might be to set the log level to info / verbose (with MS logs allowed to emit at that level) and see what it says should be a setting in your appsettings.Development.json for it
Unknown User
Unknown User•11mo ago
Message Not Public
Sign In & Join Server To View
Masta
MastaOP•11mo ago
yes i did, still the same
No description
Unknown User
Unknown User•11mo ago
Message Not Public
Sign In & Join Server To View
Masta
MastaOP•11mo ago
No description
Unknown User
Unknown User•11mo ago
Message Not Public
Sign In & Join Server To View
Masta
MastaOP•11mo ago
im not im compiling normally im suspecting of something
Unknown User
Unknown User•11mo ago
Message Not Public
Sign In & Join Server To View
Masta
MastaOP•11mo ago
look at this, isnt it supose to even send any message with an error ?
No description
Masta
MastaOP•11mo ago
it also worked for me perfectly a few days ago that's what im stressing about
Unknown User
Unknown User•11mo ago
Message Not Public
Sign In & Join Server To View
Masta
MastaOP•11mo ago
No description
Masta
MastaOP•11mo ago
this?
Unknown User
Unknown User•11mo ago
Message Not Public
Sign In & Join Server To View
Masta
MastaOP•11mo ago
i changed it and it appeared like this now
No description
Unknown User
Unknown User•11mo ago
Message Not Public
Sign In & Join Server To View
Masta
MastaOP•11mo ago
No description
Masta
MastaOP•11mo ago
same error Cannot find this localhost pageNo web page found for the web address: https://localhost:7072/ HTTP ERROR 404
Unknown User
Unknown User•11mo ago
Message Not Public
Sign In & Join Server To View
Masta
MastaOP•11mo ago
yeah i understand that i remember seeing more logs before too
Unknown User
Unknown User•11mo ago
Message Not Public
Sign In & Join Server To View
MODiX
MODiX•11mo ago
* close VS * remove the hidden folder .vs * remove all bin and obj folder next to each csproj (DO NOT TOUCH THE .git FOLDER OR WHAT'S INSIDE) * restart vs
Masta
MastaOP•11mo ago
should i do this?
Unknown User
Unknown User•11mo ago
Message Not Public
Sign In & Join Server To View
Masta
MastaOP•11mo ago
ok i did it
Unknown User
Unknown User•11mo ago
Message Not Public
Sign In & Join Server To View
Masta
MastaOP•11mo ago
nop still the same
No description
Masta
MastaOP•11mo ago
should i just create another project and replace and remake the code
Unknown User
Unknown User•11mo ago
Message Not Public
Sign In & Join Server To View
Masta
MastaOP•11mo ago
im not able to push idk why
Unknown User
Unknown User•11mo ago
Message Not Public
Sign In & Join Server To View
Mayor McCheese
Mayor McCheese•11mo ago
What happens when you push
Want results from more Discord servers?
Add your server