Reputation:
I created an ASP.NET MVC 5 Web application on my Windows machine, but when I attempt to open the solution on my mac using a fresh installation of Visual Studio Community 2017 for Mac, only to be met by this error:
System.InvalidOperationException
The view '~/Views/Home/Index.cshtml' or its master was not found or no view engine supports the searched locations. The following locations were searched:
~/Views/Home/Index.cshtml
The solution and project files are exactly the same, and other actions that return JSON work just fine. Anything regarding views results in the same error.
I'm also unable to access views the direct way using the full path to the CSHTML file (localhost:12345/Views/Home/Index.cshtml) as it throws a 404 error...
If I create a new ASP.NET MVC 5 application directly from Visual Studio for Mac, it works perfectly on the Mac (Haven't tested it on the PC yet), however all the config files and routing setup is exactly the same...
I can 100% confirm the files are there, in the correct directories, and the file permissions are allowing read and write access.
Upvotes: 0
Views: 771
Reputation:
I've managed to resolve the issue by creating the solution on the Mac, then copying all the files from the original solution into the new one.
Upvotes: 2