I think the current method of switching the references to Razor based on the build configuration is quite complicated. Unless I'm missing something, it really messes up intellisense in VS for one.
I'm thinking something like MassTransit's way of using extension methods off a configuration object to add support for alternative logging frameworks might be a better method.
It would also potentially enable us to add support for alternate view engines, eg:
ViewEngine = ViewEngineFactory.New(vec =>
{
vec.UseRazor(); // Different version of razor based on referenced nuget package
vec.UseXml(tc => tc.EndsWith("*.csxml"));
});
ViewEngine.Render(model);
I think the current method of switching the references to Razor based on the build configuration is quite complicated. Unless I'm missing something, it really messes up intellisense in VS for one.
I'm thinking something like MassTransit's way of using extension methods off a configuration object to add support for alternative logging frameworks might be a better method.
http://docs.masstransit-project.com/en/v2-master/overview/logging.html
https://github.com/MassTransit/MassTransit/blob/develop/src/Loggers/MassTransit.Log4NetIntegration/Log4NetConfigurationExtensions.cs
It would also potentially enable us to add support for alternate view engines, eg: