private void Init()
        {
            // touch assembly
            SyntaxFactory.Token(SyntaxKind.NullKeyword);

            InitOptions();
            if (Options.FullCompile)
                if (!Directory.Exists(Options.OutputPath)) Directory.CreateDirectory(Options.OutputPath);
            var wsa = assemblyDictionary.GetOrAdd(Options.WebSiteAssembly, _ => Assembly.LoadFrom(Options.WebSiteAssembly));
            configuration = GetCachedConfiguration(wsa, Options.WebSitePath);
            bindingCompiler = new AssemblyBindingCompiler(Options.BindingsAssemblyName, Options.BindingClassName, Path.Combine(Options.OutputPath, Options.BindingsAssemblyName + ".dll"), configuration);
            configuration.ServiceLocator.RegisterSingleton<IBindingCompiler>(() => bindingCompiler);
            configuration.ServiceLocator.RegisterSingleton<IControlResolver>(() => new OfflineCompilationControlResolver(configuration, this));
            if (Options.DothtmlFiles == null) Options.DothtmlFiles = configuration.RouteTable.Select(r => r.VirtualPath).ToArray();
            controlTreeResolver = configuration.ServiceLocator.GetService<IControlTreeResolver>();
            fileLoader = configuration.ServiceLocator.GetService<IMarkupFileLoader>();
            if (Options.FullCompile)
            {
                compiler = configuration.ServiceLocator.GetService<IViewCompiler>();
                compilation = compiler.CreateCompilation(Options.AssemblyName);
            }

            if (Options.SerializeConfig)
            {
                result.Configuration = configuration;
            }

            // touch assemblies
        }
        private void Init()
        {
            if (Options.FullCompile)
            {
                // touch assembly
                SyntaxFactory.Token(SyntaxKind.NullKeyword);
                InitOptions();

                if (!Directory.Exists(Options.OutputPath))
                {
                    Directory.CreateDirectory(Options.OutputPath);
                }
            }

            var wsa = assemblyDictionary.GetOrAdd(Options.WebSiteAssembly, _ => Assembly.LoadFile(Options.WebSiteAssembly));

            AssemblyResolver.LoadReferences(wsa);


            configuration = GetCachedConfiguration(wsa, Options.WebSitePath,
                                                   (services) =>
            {
                if (Options.FullCompile)
                {
                    services.AddSingleton <IBindingCompiler>(s => bindingCompiler = new AssemblyBindingCompiler(Options.BindingsAssemblyName, Options.BindingClassName, Path.Combine(Options.OutputPath, Options.BindingsAssemblyName + ".dll"), s.GetRequiredService <DotvvmConfiguration>()));
                }
            });

            if (Options.DothtmlFiles == null || !Options.DothtmlFiles.Any())
            {
                Options.DothtmlFiles = configuration.RouteTable.Select(r => r.VirtualPath).ToArray();
            }

            if (Options.FullCompile)
            {
                controlTreeResolver = configuration.ServiceProvider.GetRequiredService <IControlTreeResolver>();
                fileLoader          = configuration.ServiceProvider.GetRequiredService <IMarkupFileLoader>();
                compiler            = configuration.ServiceProvider.GetRequiredService <IViewCompiler>();
                compilation         = compiler.CreateCompilation(Options.AssemblyName);
            }

            if (Options.SerializeConfig)
            {
                result.Configuration = configuration;
            }
        }
        private void Init()
        {
            // touch assembly
            SyntaxFactory.Token(SyntaxKind.NullKeyword);

            InitOptions();
            if (Options.FullCompile)
            {
                if (!Directory.Exists(Options.OutputPath))
                {
                    Directory.CreateDirectory(Options.OutputPath);
                }
            }
            var wsa = assemblyDictionary.GetOrAdd(Options.WebSiteAssembly, _ => Assembly.LoadFrom(Options.WebSiteAssembly));

            configuration   = GetCachedConfiguration(wsa, Options.WebSitePath);
            bindingCompiler = new AssemblyBindingCompiler(Options.BindingsAssemblyName, Options.BindingClassName, Path.Combine(Options.OutputPath, Options.BindingsAssemblyName + ".dll"), configuration);
            configuration.ServiceLocator.RegisterSingleton <IBindingCompiler>(() => bindingCompiler);
            configuration.ServiceLocator.RegisterSingleton <IControlResolver>(() => new OfflineCompilationControlResolver(configuration, this));
            if (Options.DothtmlFiles == null)
            {
                Options.DothtmlFiles = configuration.RouteTable.Select(r => r.VirtualPath).ToArray();
            }
            controlTreeResolver = configuration.ServiceLocator.GetService <IControlTreeResolver>();
            fileLoader          = configuration.ServiceLocator.GetService <IMarkupFileLoader>();
            if (Options.FullCompile)
            {
                compiler    = configuration.ServiceLocator.GetService <IViewCompiler>();
                compilation = compiler.CreateCompilation(Options.AssemblyName);
            }

            if (Options.SerializeConfig)
            {
                result.Configuration = configuration;
            }

            // touch assemblies
        }