I created my dotnet 7 react application using:
dotnet new react -o my-new-app
Now, following:
I tried to add my controller called UserInfoController.cs (created within the Controllers folder)
using Microsoft.AspNetCore.Mvc;
using System.Text.Encodings.Web;
namespace my-new-app.Controllers;
public class UserInfoController : Controller
{
public string Index()
{
return "Default Action for User Controller";
}
public string Welcome()
{
return "The is the Welcome Action";
}
}
Yet, whenever I run the link that makes the call
https:// ..... /UserInfo
I get the response:
No routes matched location "/UserInfo"
The application is running anyway. I also have:
app.MapControllerRoute(
name: "default",
pattern: "{controller}/{action=Index}/{id?}");
Am I missing something?




app.MapControllerRoute.