What is this- BoC.Web.Mvc.PrecompiledViews.ApplicationPartRegistry
I'm trying to compile in ASP .NET MVC 3 project my Views to dll,- that's ok, but when i register dlls, i have problem here:
var assembly = Assembly.LoadFr开发者_运维知识库om(dll.FullName);
// register compiled razor views
// e.g. 'settings.cshtml' is registered as '~/extensions/plugins/rating/settings.cshtml'
BoC.Web.Mvc.PrecompiledViews.ApplicationPartRegistry.Register(assembly, pluginDir);
I can't understand, what's that- BoC?
Source: http://mikakolari.fi/2011/02/aspnetmvc-3-plugin-architecture-with-embedded-razor-views/
Solution: When u compile your Views, u have 2 files in bin/Debug:
- Commons.Web.Mvc.PrecompiledViews.dll
- Crash.PageRating.dll
So, BoC.Web.Mvc.PrecompiledViews.ApplicationPartRegistry is in Commons.Web.Mvc.PrecompiledViews.dll which u have to Add to your project.
I can't get that MSDN link to work. The BoC
stuff is by Chris van de Steeg and the source code is here and Commons.Web.Mvc.PrecompiledViews.dll
specifically is here.
Having said all of that, in this blog post Chris seems to recommend using David Ebbo's razorgenerator instead.
By now, this is all integrated in the RazorGenerator.Mvc
NuGet package. See my answer here: https://stackoverflow.com/a/33263732/331281.
精彩评论