/// <summary> /// This checks what the default rendering engine is set in config but then also ensures that there isn't already /// a template that exists in the opposite rendering engine's template folder, then returns the appropriate /// rendering engine to use. /// </summary> /// <returns></returns> /// <remarks> /// The reason this is required is because for example, if you have a master page file already existing under ~/masterpages/Blah.aspx /// and then you go to create a template in the tree called Blah and the default rendering engine is MVC, it will create a Blah.cshtml /// empty template in ~/Views. This means every page that is using Blah will go to MVC and render an empty page. /// This is mostly related to installing packages since packages install file templates to the file system and then create the /// templates in business logic. Without this, it could cause the wrong rendering engine to be used for a package. /// </remarks> public RenderingEngine DetermineTemplateRenderingEngine(ITemplate template) { using (var scope = ScopeProvider.CreateScope(autoComplete: true)) { return(_templateRepository.DetermineTemplateRenderingEngine(template)); } }