Web page not found .net core 2.1 - asp.net-core

I am new to working with asp.net core 2.1, I have added few Razor Views but on publishing application to azure, I am unable to access those pages. I get "no web page was found" error.
Here is My Solution explorer
I guess there is an issue with StartUp.cs wherein, I need to route things but I didn't find proper documentation since I am using .net core 2.1.

Related

Not able to see use all WSDL content on .NET Core Web API

I'm not able to see all of the methods of the Web Services that I want to use on my .NET CORE Web API project on Visual Studio 2019.
Unlike on a Console Application project that I used to work with and add the .WSDL through the "Add Connected Services" method.
2 projects. Same WSDL. Different results.
Here's an example of the method that I need to use and it's there (AuthenticateUser) :
Here is how it looks on reference file on the Console Application project :
Here is a screenshot from the .NET CORE Web API project which the AuthenticateUser() method cannot be found on the reference file :
Same service, different result.
I've already seen some posts here such as :
Wcf service works in .NET Core 3.1 console app, but fails to work in ASP.NET Core 3.1 Web API
Doesn't seems to be working for me.
What am I missing?

Can we write the .net core WebAPI in the asp.net core razor web page itself?

I have the following projects in my solution all .net core 5.0.
myproject.domain
myproject.infrastructre
myproject.webAPI
myproject.UI.Razorweb page.
Instead of using SPA which calls the webAPI, I am using razor web page which will call the webAPI(.net 5.0). My question is can we merge the webAPI and the razorwebpage into one? Can we write webAPI in the razor web page itself?
Is that allowed?
I agree with the suggestion given by Jeremy.
You should have a web API and Razor project separate.
Besides, if you would like to make some tests then you could refer to the articles below.
Use Razor Pages, MVC, And Web API In A Single ASP.NET Core Application
Hosting ASP.NET Core Razor Pages and Web APIs in a Single Project
Razor pages and webapi in the same project

How do I troubleshoot auto-refresh failing silently in ASP.NET Core 5?

I read about the Auto-refresh capability introduced in ASP.NET Core 5 with .NET 5. I upgraded my Blazor site to .NET 5, and thought it would just work, but it doesn't seem to be working for me.
I used to use Westwind.AspNetCore.LiveReload, but I have removed it to try this out.
When I make a change, the app rebuilds and restarts web server for me, but the browser doesn't refresh. This is a project I upgraded from .NET Core 3.1. Is there anything that needs to be done in startup.cs to enable this? What else could be interfering? How can I troubleshoot?
You can livereload page using methods mentioned in that question answers
.NET Core MVC Page Not Refreshing After Changes

Swagger page is blank

I am running this .net core 3.1 api project and i got swashbuckle installed and configured swagger on the startup. However when i navigate to http://localhost:5000/swagger/index.html the page is totally empty. Can someone advise how to properly configure the project?

Running ASP.NET Core within/alongside an existing ASP.NET WebForms project in Visual Studio and IIS Express

I have a large Visual Studio solution with several ASP.NET web sites with a mix of WebForms, MVC and WebAPI. What I'd like to be able to do is add an ASP.NET Core project to this solution to provide MVC, Razor Pages, WebAPI and SPA (Vue.JS in this case) facilities. The plan is to take each WebForms page at a time and convert to the new framework.
I'll target .NET Framework and the Core site will share some assemblies from the WebForms - but no state is shared except a session cookie and any state stored in the database.
I specifically want to be able to serve the new framework from IIS Express on the same port. So for example, an old page such as http://localhost:1234/page1.aspx will be converted to http://localhost:1234/core/page1. However, I'm unable to simply change the Core project to be hosted on IIS Express and change the path to http://localhost:1234/core. I have managed by following instructions to host in IIS but this has several disadvantages for development. I've also tried adding <urlRewrite> configuration to the WebForms site to forward requests to Core running on a different port but I wasn't very successful and I believe POST request are not supported which renders it fairly useless!