/// <summary>
        /// Initializes the entry point by compiling the script and loading/saving the assembly
        /// </summary>
        /// <returns>Taks for initializing entry point.</returns>
        public async Task InitializeEntryPointAsync()
        {
            var referenceResolver = new MemoryReferenceResolver(_frameworkLoads);
            ICompilationService compilationService = CompilationServiceFactory.CreateService(_entityMetaData, GetScriptOptions(referenceResolver));

            _compilation = await compilationService.GetCompilationAsync();

            _diagnostics = await _compilation.GetDiagnosticsAsync();

            References = referenceResolver.Used.ToImmutableArray();

            IsCompilationSuccessful = !_diagnostics.Any(d => d.Severity == DiagnosticSeverity.Error);
            CompilationOutput       = _diagnostics.Select(m => m.ToString());

            if (IsCompilationSuccessful)
            {
                try
                {
                    memberInfo = await _compilation.GetEntryPoint();

                    InitializeAttributes();
                    Validate();
                }
                catch (Exception ex)
                {
                    if (ex is ScriptCompilationException scriptEx)
                    {
                        IsCompilationSuccessful = false;

                        if (scriptEx.CompilationOutput.Any())
                        {
                            CompilationOutput = CompilationOutput.Concat(scriptEx.CompilationOutput);
                        }

                        return;
                    }

                    throw;
                }
            }
        }
        public async Task <Tuple <string, string> > GetAssemblyBytesAsync()
        {
            var referenceResolver = new MemoryReferenceResolver(_frameworkLoads);
            ICompilationService compilationService = CompilationServiceFactory.CreateService(_entityMetaData, GetScriptOptions(referenceResolver));

            _compilation = await compilationService.GetCompilationAsync();

            _diagnostics = await _compilation.GetDiagnosticsAsync();

            References = referenceResolver.Used.ToImmutableArray();

            IsCompilationSuccessful = !_diagnostics.Any(d => d.Severity == DiagnosticSeverity.Error);
            CompilationOutput       = _diagnostics.Select(m => m.ToString());

            if (!IsCompilationSuccessful)
            {
                throw new ScriptCompilationException(CompilationOutput);
            }

            return(await _compilation.GetAssemblyBytesAsync());
        }