private void BuildView(DotHtmlFileInfo file, List <DotHtmlFileInfo> tempList)
        {
            if (file.Status != CompilationState.NonCompilable)
            {
                try
                {
                    var controlFactory = Context.Services.GetRequiredService <IControlBuilderFactory>();

                    var pageBuilder = controlFactory.GetControlBuilder(file.VirtualPath);

                    var compiledControl = pageBuilder.builder.Value.BuildControl(controlFactory, Context.Services);

                    if (compiledControl is DotvvmView view && view.Directives.TryGetValue(
                            ParserConstants.MasterPageDirective,
                            out var masterPage))
                    {
                        if (MasterPages.All(s => s.VirtualPath != masterPage) && tempList.All(s => s.VirtualPath != masterPage))
                        {
                            tempList.Add(new DotHtmlFileInfo()
                            {
                                VirtualPath = masterPage
                            });
                        }
                    }

                    file.Status    = CompilationState.CompletedSuccessfully;
                    file.Exception = null;
                }
                catch (Exception e)
                {
                    file.Status    = CompilationState.CompilationFailed;
                    file.Exception = e.Message;
                }
            }
        }
 public void BuildView(DotHtmlFileInfo file)
 {
     BuildView(file, MasterPages);
 }