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
43 Replies
What controllers do you have?
404 in this case means no index page was found
I have one controller its the StudentController
the index controller part is right here
@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 itDo you still have a Home controller for that
Home/Error
redirect in your Program.cs?Unknown User•11mo ago
Message Not Public
Sign In & Join Server To View
I dont have it anymore
This is a database that im using from MSql
Mby add it back and see if that fixes your 404 🙂
Unknown User•11mo ago
Message Not Public
Sign In & Join Server To View
ye learning to love DI is a whole step in the learning process
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
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 itUnknown User•11mo ago
Message Not Public
Sign In & Join Server To View
yes i did, still the same
Unknown User•11mo ago
Message Not Public
Sign In & Join Server To View
Unknown User•11mo ago
Message Not Public
Sign In & Join Server To View
im not im compiling normally
im suspecting of something
Unknown User•11mo ago
Message Not Public
Sign In & Join Server To View
look at this, isnt it supose to even send any message with an error ?
it also worked for me perfectly a few days ago that's what im stressing about
Unknown User•11mo ago
Message Not Public
Sign In & Join Server To View
this?
Unknown User•11mo ago
Message Not Public
Sign In & Join Server To View
i changed it and it appeared like this now
Unknown User•11mo ago
Message Not Public
Sign In & Join Server To View
same error Cannot find this localhost pageNo web page found for the web address: https://localhost:7072/
HTTP ERROR 404
Unknown User•11mo ago
Message Not Public
Sign In & Join Server To View
yeah i understand that i remember seeing more logs before too
Unknown User•11mo ago
Message Not Public
Sign In & Join Server To View
* 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 vsshould i do this?
Unknown User•11mo ago
Message Not Public
Sign In & Join Server To View
ok i did it
Unknown User•11mo ago
Message Not Public
Sign In & Join Server To View
nop still the same
should i just create another project and replace and remake the code
Unknown User•11mo ago
Message Not Public
Sign In & Join Server To View
im not able to push idk why
Unknown User•11mo ago
Message Not Public
Sign In & Join Server To View
What happens when you push