I created a new .Net Core MVC web application in Visual Studio 2015. The IDE is completely updated and I have the latest SDK.net core installed. It consists of a solution file and several project files. I can successfully launch it and go to the home page.
Then I opened the root folder (solutions folder) in Visual Studio Code and tried to start it. Everything seems to have started fine, however it cannot find the default view for "Views / Home / Index.cshtml".
I get the following error:
InvalidOperationException: Index view not found. The following locations were searched: /Views/Home/Index.cshtml /Views/Shared/Index.cshtml
The program.cs file is as follows:
var host = new WebHostBuilder()
.UseKestrel()
.UseContentRoot(Directory.GetCurrentDirectory())
.UseIISIntegration()
.UseStartup<Startup>()
.Build();
host.Run();
The .json project has the following:
"buildOptions": {
"emitEntryPoint": true,
"preserveCompilationContext": true
},
"publishOptions": {
"include": [
"wwwroot",
"Views",
"Areas/**/Views",
"appsettings.json",
"web.config"
]
}
, , , , VSC.
?