Jan 30

Build fails (of test project) but no errors are reported in the Visual Studio 2012 Build Output window after nuget package update

After updating my nuget packages my build of the test project was failing, without any error reported in the build output window.

First of all you can turn on verbose logging:

  • Tools
  • Options
  • Project and Solutions
  • Build and Run
  • Set these to options to Diagnostic:
    • MSBuild project build output verbosity
    • MSBuild project build log file verbosity

Probably you’ll see the error appearing in you build log file of in the build output file.

In my case the System.web.mvc reference was updated, but the fake assembly that I had generated was not updated and one assembly was missing.

Jan 20

The “RenderBody” method has not been called for layout page

When rendering a CSHTML webpage that includes a PartialView (or is a PartialView) when using MVC you get the error message:

The “RenderBody” method has not been called for layout page

This typically occurs when you:
– have a partial view
– use a _ViewStart.cshtml page
– you call the partival view from your controller using: return View();

And there you go wrong. It is a partial view, so you should return like this:

return PartialView();

That’s all there is to it.