/////////////////////////////////////////

        public static void Init()
        {
            if (!initialized)
            {
                try
                {
                    if (CanCompileScripts)
                    {
                        scriptAssemblyNameResolver = new ScriptAssemblyNameResolver();
                        scriptAssemblyNameResolver.AddSearchDirectory(VirtualFileSystem.Directories.Binaries);

                        InitReferenceAssemblies();
                        InitUsingNamespaces();

#if !NO_EMIT
                        ScriptCompiler.Settings = ScriptCompiler.Settings.AddReferences(CSharpScriptReferenceAssemblies);
#endif
                    }

                    scriptCache.Initialize();

                    initialized = true;
                }
                catch (Exception e)
                {
                    Log.Warning("Scripting engine initialization failed. " + e.Message);
                }
            }
        }
        /////////////////////////////////////////

        public static void Init()
        {
            if (!initialized)
            {
                try
                {
                    if (CanCompileScripts)
                    {
                        scriptAssemblyNameResolver = new ScriptAssemblyNameResolver();
                        scriptAssemblyNameResolver.AddSearchDirectory(VirtualFileSystem.Directories.Binaries);

                        {
                            var folder = PathUtility.Combine(VirtualFileSystem.Directories.PlatformSpecific, @"dotnet\shared\Microsoft.WindowsDesktop.App\3.1.6");
                            if (Directory.Exists(folder))
                            {
                                scriptAssemblyNameResolver.AddSearchDirectory(folder);
                            }
                        }
                        {
                            var folder = PathUtility.Combine(VirtualFileSystem.Directories.PlatformSpecific, @"dotnet\shared\Microsoft.NETCore.App\3.1.6");
                            if (Directory.Exists(folder))
                            {
                                scriptAssemblyNameResolver.AddSearchDirectory(folder);
                            }
                        }
                        //scriptAssemblyNameResolver.AddSearchDirectory( Path.Combine( VirtualFileSystem.Directories.PlatformSpecific, @"dotnet\shared\Microsoft.WindowsDesktop.App\3.1.6" ) );
                        //scriptAssemblyNameResolver.AddSearchDirectory( Path.Combine( VirtualFileSystem.Directories.PlatformSpecific, @"dotnet\shared\Microsoft.NETCore.App\3.1.6" ) );

                        InitReferenceAssemblies();
                        InitUsingNamespaces();

#if !NO_EMIT
                        ScriptCompiler.Settings = ScriptCompiler.Settings.AddReferences(CSharpScriptReferenceAssemblies);
#endif
                    }

                    scriptCache.Initialize();

                    initialized = true;
                }
                catch (Exception e)
                {
                    Log.Warning("Scripting engine initialization failed. " + e.Message);
                }
            }
        }