MVC System.Web.HttpCompileException in Html.RenderPartial

I get a System.Web.HttpCompileException when my view throws an Html.RederPartial . Exception Message:

Additional Information: The external component has thrown an exception.

I checked that:

  • The controller does not throw an exception
  • Partial view exists
  • Model transmitted by the controller and received from it is the same.
  • InnerException is null

It seems like the exception sounds like the html or razor is wrong or wrong, but the solution builds fine. He also worked not so long ago, so I assume that I am missing something stupid ...

My question is:

Does anyone know how to find out what causes this exception? Or is there a way to get more information about the exception?

Edit: Here's the StackTrace

in System.Web.Compilation.AssemblyBuilder.Compile () in System.Web.Compilation.BuildProvidersCompiler.PerformBuild () in System.Web.Compilation.BuildManager.CompileWebFile (VirtualPath virtualPath) in System.Web.Compilation.BuildPathIntalGu virtualPath, Boolean noBuild, Boolean ...

+5
source share
2 answers

It turns out that it was a stupid mistake on my part. MVC could not compile Html from Razor because I renamed the property to my Model but did not .cshtml it in .cshtml .

Include Razor build errors at compile time. Modify the csproj and install the following:

 <MvcBuildViews>true</MvcBuildViews> 

Thanks to JP for this SO post .

+13
source

I found that one of my partial ie * .cshtml HTML file files is missing links. Usually, when any cshtml page that has an error on it is not displayed at compile time, although you can track it with debugging points

0
source

All Articles