Reputation: 544
I created a solution with multiple applications and I configure routes like this :
app.UseMvc(routes =>
{
routes.MapRoute(
name: "ControlPanel",
template: "ControlPanel/{controller=Home}/{action=Index}/{id?}");
routes.MapRoute(
name: "default",
template: "{controller=Home}/{action=Index}/{id?}");
});
I can navigate to ControlPanel project and it goes into ihome controller in but i shows this error :
I find out that it sets base directory in my program.cs when project runs first time and it is my main webapplication assembly name (CustomerProject) :
so now how can I change ContentDirectory and wwwroot directory to new assembly name?
Upvotes: 0
Views: 556
Reputation: 2629
I guess you went to URL has controller name without specifying action method or it was smth like this yourhost/iHome/Index
, so as for result you have executed Index
action of iHome
controller and there is no Index.cshtml
in your solution. View engine can't find a specific page for your request, so try to add Index.cshtml
into /Views/iHome/
or into /Views/Shared/
folders.
Also, I can suggest reading this for common understanding how views discovery works.
Upvotes: 1