Ich habe folgende Controller in asp.net Core MVC.LoginController nicht in ASP.NET Core MVC (In Visual Studio-Code)
Aber wenn ich URL wie localhost laden: 5000/Login/Callback.
Es ruft HomeController Index-Methode. Was mache ich falsch? In startup.cs habe ich folgendes in Configure Method.
app.UseMvc(routes =>
{
routes.MapRoute(
name: "default",
template: "{controller=Home}/{action=Index}/{id?}");
routes.MapSpaFallbackRoute(
name: "spa-fallback",
defaults: new { controller = "Home", action = "Index" });
});
Hey, Pals. Danke für deine Antworten. Ich habe vergessen zu erwähnen, dass ich das Projekt im Visual Studio Code ausgeführt habe. Als ich das Projekt in vs2017 gestartet habe, funktioniert es jetzt. Vielleicht ist das Build-Problem. Nun stellt sich die Frage, wie man ein Projekt im Visual Studio-Code erstellt (oder wieder herstellt)?
ich ein neues asp.net Core-Projekt hier erstellt, eine Login-Controller erstellt .. und es funktioniert .. werfen Sie einen Blick https://ibb.co/k9kb1v –
app.UseMvc (Routen => { routes.MapRoute ( Name: "default", Vorlage: "{controller = Start}/{action = Index}/{id}"); }); –
Ich habe die Frage aktualisiert. Bitte guck dir das an. –