'Disable razor files generation on compilation error in .cshtml

I need to disable the generation of .cshtml.cs file in obj folder, on changes made to the .cshtml file in Visual Studio.

enter image description here

Is there any resolution to this?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source