-
Notifications
You must be signed in to change notification settings - Fork 2.1k
What are the current guidelines on view precompilation (MvcBuildViews etc.)? #3993
Comments
We are removing precompilation support in RC2 (#3917) due to issues with getting it to work on the new .NET CLI. We will revisit precompilation in a future release. |
That makes sense Just to confirm - is that a future release, as in, future release after final of v6 (e.g. 6.1), or a future RC? (I'm assuming the former, but I'm not clear on how many RCs etc. are expected or the anticipated ship date for 6 etc.) |
I have been trying to use portable areas using .NET MVC 6 RC1 whereby each area exists in a separate class library project using precompiled views and have not been able to get it to work I have been getting the error message “An unhandled exception occurred while processing the request. ArgumentNullException: Value cannot be null, Parameter name: type”. I was wondering whether this is a known issue or whether I have gone wrong somewhere in my code? Just to echo the previous posters question – if support for pre-compiled views is being removed from RC2 – when will it be re-introduced? |
@nicholaj05, embedding the views should be an alternative for now - https://github.com/aspnet/Mvc/tree/dev/samples/EmbeddedViewSample.Web, https://github.com/johnnyoshika/mvc6-view-components. Another work item that discusses something similar - #3750 |
Could you include a stack trace with this or provide a minimal sample that causes the exception. |
A future release after final. Not a future RC. |
Previously the RazorGenerator team said they had no plans to produce a version for MVC6, due to the fact that MVC 6 supports precompile views. |
Ouch. Removed features after RC is painful. I'll take a look at EmbeddedFileProvider. |
But what about strongly typed views? Let's say I have some assembly A that have controller, view and view model class defined (and view build as resource). I add this A as application part to the main app and get runtime compilation error that view model class is not defined (because there are no link to assembly A in the project.json). Is there any way to add assemblies to the Razor views compilation process now? Thanks! |
@DmitrySikorsky - we're working on using |
There are a multitude of blogs and posts mentioning
RazorPreCompileModule
(example) but this does not appear to work in RC1Other issues related to precompilation mention the use of the Publish options for 'compile source' etc. but this only seems to affect controller code etc. and not views
What is the current approach to precompiling views in RC1? (e.g. at the point of publish)
EDIT:
To clarify, I'm referring to MVC 6.0 RC1 -final against DNX 4.5.1
The text was updated successfully, but these errors were encountered: