Ich benutze 2017 VC für Mac, die Xamarian -Version von VS hat nicht den Auto -Bereich Mapper. Ich habe den Ordner der Bereiche manuell hinzugefügt und das Routing ordnungsgemäß konfiguriert. Wenn ich meiner Haupt -CSHTML -Seite einen ActionLink hinzufüge, werfen sie einen 500 -Fehler und die Angabe. < /P>
System.InvalidOperationException
The view 'Billing' or its master was not found or no view engine supports the searched locations. The following locations were searched:
~/Views/BillingMain/Billing.cshtml
~/Views/BillingMain/Billing.vbhtml
~/Views/Shared/Billing.cshtml
~/Views/Shared/Billing.vbhtml
~/Views/BillingMain/Billing.aspx
~/Views/BillingMain/Billing.ascx
~/Views/Shared/Billing.aspx
~/Views/Shared/Billing.ascx
Stattdessen sollte es in ~/rächen/Abrechnungen/Ansichten/BillingMainController suchen.
Project-
AppStart-
Areas-
Billing-
Invoice-
Controllers-
Scripts-
Views-
Global.asax
< /code>
Ich teste nur den Abrechnungsbereich, im Folgenden ist der Rest meines Codes.using System.Web.Mvc;
using System.Web.Routing;
namespace WORK_GODDAMN
{
public class RouteConfig
{
public static void RegisterRoutes(RouteCollection routes)
{
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
//AreaRegistration.RegisterAllAreas();
routes.MapRoute(
name: "Default",
url: "{controller}/{action}/{id}",
defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional }
//,namespaces: new string[] { "WORK_GODDAMN.Areas.Controllers" }
);
}
}
< /code>
} < /p>
BillingArearegistration.cs
using System;
using System.Web.Mvc;
namespace WORK_GODDAMN.Areas.Billing
{
public class BillingAreaRegistration : AreaRegistration
{
public override string AreaName
{
get
{
return "Billing";
}
}
public override void RegisterArea(AreaRegistrationContext context)
{
context.MapRoute(
"Billing_Default",
"Billing/{controller}/{action}/{id}",
new {controller = "BillingMain", action = "Index", id = UrlParameter.Optional }
, namespaces: new string[] { "WORK_GODDAMN.Areas.Billing.Controllers" }
);
}
}
}
< /code>
global.asax
using System.Web;
using System.Web.Mvc;
using System.Web.Routing;
using System.Web.Http;
namespace WORK_GODDAMN
{
public class Global : HttpApplication
{
protected void Application_Start()
{
AreaRegistration.RegisterAllAreas();
RouteConfig.RegisterRoutes(RouteTable.Routes);
GlobalConfiguration.Configure(WebApiConfig.Register);
}
}
}
< /code>
main _layout.cshtml Hier leitet der Aktions -Link weiter und glaube, ich mache hier vielleicht etwas falsch, aber an diesem Punkt habe ich keine Ahnung, was das [url=viewtopic.php?t=26065]Problem[/url] verursachen könnte. < /p>
@using System.Web.Optimization
@ViewBag.Title
@Scripts.Render("~/Scripts/modernizr.js")
{Demo}- Pluggable Modules
@Html.ActionLink("Home","Index","Home", new {Area=""}, null)
@Html.ActionLink("Invoice","Index","InvoiceMain", new {Area=""}, null)
@Html.ActionLink("Billing","Index","BillingMain", new {Area=""}, null)
@RenderBody()
@Scripts.Render("~/Scripts/jquery.js")
@RenderSection("Scripts", required: false)
Ich benutze 2017 VC für Mac, die Xamarian -Version von VS hat nicht den Auto -Bereich Mapper. Ich habe den Ordner der Bereiche manuell hinzugefügt und das Routing ordnungsgemäß konfiguriert. Wenn ich meiner Haupt -CSHTML -Seite einen ActionLink hinzufüge, werfen sie einen 500 -Fehler und die Angabe. < /P>
[code]System.InvalidOperationException The view 'Billing' or its master was not found or no view engine supports the searched locations. The following locations were searched: ~/Views/BillingMain/Billing.cshtml ~/Views/BillingMain/Billing.vbhtml ~/Views/Shared/Billing.cshtml ~/Views/Shared/Billing.vbhtml ~/Views/BillingMain/Billing.aspx ~/Views/BillingMain/Billing.ascx ~/Views/Shared/Billing.aspx ~/Views/Shared/Billing.ascx [/code]
Stattdessen sollte es in ~/rächen/Abrechnungen/Ansichten/BillingMainController suchen.[code]Project- AppStart- Areas- Billing- Invoice- Controllers- Scripts- Views- Global.asax < /code>
Ich teste nur den Abrechnungsbereich, im Folgenden ist der Rest meines Codes.using System.Web.Mvc; using System.Web.Routing;
namespace WORK_GODDAMN { public class RouteConfig { public static void RegisterRoutes(RouteCollection routes) { routes.IgnoreRoute("{resource}.axd/{*pathInfo}"); //AreaRegistration.RegisterAllAreas(); routes.MapRoute( name: "Default", url: "{controller}/{action}/{id}", defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional } //,namespaces: new string[] { "WORK_GODDAMN.Areas.Controllers" } );
} } < /code>
} < /p>
BillingArearegistration.cs
using System; using System.Web.Mvc;
namespace WORK_GODDAMN.Areas.Billing {
public class BillingAreaRegistration : AreaRegistration { public override string AreaName { get { return "Billing"; } }
public override void RegisterArea(AreaRegistrationContext context) { context.MapRoute( "Billing_Default", "Billing/{controller}/{action}/{id}", new {controller = "BillingMain", action = "Index", id = UrlParameter.Optional } , namespaces: new string[] { "WORK_GODDAMN.Areas.Billing.Controllers" } );
} }
} < /code>
global.asax
using System.Web; using System.Web.Mvc; using System.Web.Routing; using System.Web.Http;
namespace WORK_GODDAMN { public class Global : HttpApplication { protected void Application_Start() { AreaRegistration.RegisterAllAreas(); RouteConfig.RegisterRoutes(RouteTable.Routes); GlobalConfiguration.Configure(WebApiConfig.Register); } } } < /code>
main _layout.cshtml Hier leitet der Aktions -Link weiter und glaube, ich mache hier vielleicht etwas falsch, aber an diesem Punkt habe ich keine Ahnung, was das [url=viewtopic.php?t=26065]Problem[/url] verursachen könnte. < /p>
@Html.ActionLink("Home","Index","Home", new {Area=""}, null) @Html.ActionLink("Invoice","Index","InvoiceMain", new {Area=""}, null) @Html.ActionLink("Billing","Index","BillingMain", new {Area=""}, null)
Ich benutze 2017 VC für Mac, die Xamarian -Version von VS hat nicht den Auto -Bereich Mapper. Ich habe den Ordner der Bereiche manuell hinzugefügt und das Routing ordnungsgemäß konfiguriert. Wenn ich...
So verweisen Sie auf lokale application.yml anstelle anderer .yml -Dateien. Intellij nimmt standardmäßig application.yml. Ich möchte die Konfiguration ändern, um auf lokale YML zu verweisen, damit...
So verweisen Sie auf lokale application.yml anstelle anderer .yml -Dateien. Intellij nimmt standardmäßig application.yml. Ich möchte die Konfiguration ändern, um auf lokale YML zu verweisen, damit...
Ich arbeite mit einem Wörterbuch, das eine Mischung aus Listen und Bereichen enthält (die in Listen verarbeitet werden), aber wenn ich versuche, es in einen Pandas-DataFrame zu konvertieren, erhalte...
Ich arbeite mit einem Wörterbuch, das eine Mischung aus Listen und Bereichen enthält (die in Listen verarbeitet werden), aber wenn ich versuche, es in einen Pandas-DataFrame zu konvertieren, erhalte...