I am having a Weird and annoying problem. In my ASP.NET MVC 5 project, time to time, I see that _ViewStart file and Shared/_Layout.cshtml files are created automatically even though I did not want. So, I deleted those files but these files are getting created time to time by itself. That cause a great problem because, sometimes, if I dont notice that these files are created, I can accidentally publish the website and then, after publish, I notice that all pages are being wrapped by the auto created _Layout.cshtml file. Is it a smart helping feature of Visual Studio 2013 ? Cant we stop this ?
Emran!
I am not sure that you still need the answer but today I have also met similar problem. By some unknown reason file "Shared/_Layout.cshtml" was automatically added to my Project.
I was realy wondering why could it happen and I found which actions should be performed to make this file be created.
I have added new View to my Project and have used for it standard VS resources:
My VS was thinking a lot and suddenly created new view and also... "Shared/_Layout.cshtml" and "Shared/_ViewStart.cshtml" files!! I do not think that this option might be switched off because it is logically to create layout page when it has been missed.
Hope this info is helpful for you and for anybody else :)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With