Set MvcBuildViews to false in csproj to configure debugging.
<MvcBuildViews Condition=" '$(Configuration)' != 'Debug' ">true</MvcBuildViews>
Add the following external command to the Tools / External Tools menu
Title: Compile with MVC views Command: C:\Windows\Microsoft.NET\Framework64\v4.0.30319\MSBuild.exe Arguments: $(SolutionDir)$(SolutionFileName) /p:MvcBuildViews=true Initial directory: $(SolutionDir) Use Output window: checked
Then add a shortcut to this: go to tools / options / environmentnement / keyboard Find the "Tools.ExternalCommandX" command, where X is the position of your external command to which you just added it. Assign a key (Ex: Ctrl-shift-1)
Now explanations: We have the same problem. We donβt want to compile the views most of the time, but we like to compile them before checking the code, so we collect the views 1 time out of 50 or something like that. To achieve this, I added an external tool command for msbuild with the mvcbuildviews parameter. The only drawback is that errors are not indicated in the error window of the visual studio, you need to look at the output window and double-click on the errors, if any.
Yepeekai
source share