Beispiel #1
0
        private void btnGenerate_Click(object sender, EventArgs e)
        {
            AppDomain.CurrentDomain.AssemblyResolve += CurrentDomain_AssemblyResolve;

            foreach (int index in clbFiles.CheckedIndices)
            {
                cbPaths.SetItemChecked(index, true);
            }
            var selectedFiles = cbPaths.CheckedItems.OfType <object>().Select(x => x.ToString());

            if (selectedFiles.IsNullOrEmpty())
            {
                MessageBox.Show("You must select at least one assembly.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }
            string name = fileName.Text;
            string val  = assembliesPath;

            if (outLocation != null)
            {
                val = outLocation;
            }
            JsonHelpFileGenerator.Generate(selectedFiles, val, name);
            MessageBox.Show("The " + name + ".json has been generated in the specified folder.", "Success", MessageBoxButtons.OK, MessageBoxIcon.Information);

            AppDomain.CurrentDomain.AssemblyResolve -= CurrentDomain_AssemblyResolve;
        }
Beispiel #2
0
        private static void Main(string[] args)
        {
            // TODO: Change this to the location where your assemblies are
            string assembliesPath = @"D:\Source\GitHub\Extenso\DoxieDummy\bin\Release\netcoreapp2.1";

            AssemblyLoadContext.Default.Resolving += (context, name) =>
            {
                string path = Path.Combine(assembliesPath, name.Name + ".dll");

                if (File.Exists(path))
                {
                    return(AssemblyLoadContext.Default.LoadFromAssemblyPath(path));
                }

                return(null);
            };

            // TODO: Modify this to include the assemblies that you want to show in Doxie
            var selectedFiles = new[]
            {
                Path.Combine(assembliesPath, "Extenso.AspNetCore.Mvc.dll"),
                Path.Combine(assembliesPath, "Extenso.AspNetCore.Mvc.ExtensoUI.dll"),
                Path.Combine(assembliesPath, "Extenso.AspNetCore.Mvc.ExtensoUI.Foundation.dll"),
                Path.Combine(assembliesPath, "Extenso.AspNetCore.Mvc.ExtensoUI.JQueryUI.dll"),
                Path.Combine(assembliesPath, "Extenso.AspNetCore.Mvc.ExtensoUI.KendoUI.dll"),
                Path.Combine(assembliesPath, "Extenso.AspNetCore.OData.dll"),
                Path.Combine(assembliesPath, "Extenso.Core.dll"),
                Path.Combine(assembliesPath, "Extenso.Data.dll"),
                Path.Combine(assembliesPath, "Extenso.Data.Entity.dll"),
                Path.Combine(assembliesPath, "Extenso.Data.MySql.dll"),
                Path.Combine(assembliesPath, "Extenso.Data.Npgsql.dll"),
                Path.Combine(assembliesPath, "Extenso.Data.QueryBuilder.dll"),
                Path.Combine(assembliesPath, "Extenso.Data.QueryBuilder.MySql.dll"),
                Path.Combine(assembliesPath, "Extenso.Data.QueryBuilder.Npgsql.dll")
            };

            string outputPath = assembliesPath;

            Console.WriteLine("Generating...");
            JsonHelpFileGenerator.Generate(selectedFiles, outputPath);
            Console.WriteLine("Done");

            Console.ReadLine();
        }
        private static void Main(string[] args)
        {
            var    startupPath = new DirectoryInfo(Path.GetDirectoryName(Assembly.GetEntryAssembly().Location)).Parent.Parent.Parent;
            string examplePath = Path.Combine(startupPath.FullName, "SomeArbitraryPath");

            // Shouldn't need to do this, but to try solve the "Can't load assembly XYZ" errors, I try to load all assemblies to this console app...
            //  NOTE: It doesn't work anyway... it still gives those errors, even when I can see in AppDomain.CurrentDomain.GetAssemblies() that the assemblies
            //      in question are in fact loaded...
            //AssemblyLoader.LoadAssemblyFromFilePath(examplePath);

            var selectedFiles = new[]
            {
                Path.Combine(examplePath, "Extenso.AspNetCore.Mvc.dll"),
                Path.Combine(examplePath, "Extenso.AspNetCore.Mvc.ExtensoUI.dll"),
                Path.Combine(examplePath, "Extenso.AspNetCore.Mvc.ExtensoUI.Foundation.dll"),
                Path.Combine(examplePath, "Extenso.AspNetCore.Mvc.ExtensoUI.JQueryUI.dll"),
                Path.Combine(examplePath, "Extenso.AspNetCore.Mvc.ExtensoUI.KendoUI.dll"),
                Path.Combine(examplePath, "Extenso.AspNetCore.OData.dll"),
                Path.Combine(examplePath, "Extenso.Core.dll"),
                Path.Combine(examplePath, "Extenso.Data.dll"),
                Path.Combine(examplePath, "Extenso.Data.MySql.dll"),
                Path.Combine(examplePath, "Extenso.Data.Npgsql.dll"),
                Path.Combine(examplePath, "Extenso.Data.QueryBuilder.dll"),
                Path.Combine(examplePath, "Extenso.Data.QueryBuilder.MySql.dll"),
                Path.Combine(examplePath, "Extenso.Data.QueryBuilder.Npgsql.dll")
            };

            string outputPath = examplePath;

            Console.WriteLine("Generating...");

            // This runs fine, but there are always errors inside the generated file (see assemblies.json in outputPath).
            // Example error: "Could not load file or assembly 'Microsoft.AspNetCore.Mvc.ViewFeatures", even thought
            // Errors are caught and added to the generated file. See code file DocParser.cs at lines #226, #402 and #471.
            JsonHelpFileGenerator.Generate(selectedFiles, outputPath);
            Console.WriteLine("Done");

            Console.ReadLine();
        }
Beispiel #4
0
        private void btnGenerate_Click(object sender, EventArgs e)
        {
            AppDomain.CurrentDomain.AssemblyResolve += CurrentDomain_AssemblyResolve;

            var selectedFiles = clbFiles.CheckedItems.OfType <object>().Select(x => x.ToString());

            if (selectedFiles.IsNullOrEmpty())
            {
                MessageBox.Show("You must select at least one assembly.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }

            JsonHelpFileGenerator.Generate(selectedFiles, assembliesPath);
            MessageBox.Show("The assemblies.json has been generated in the specified folder.", "Success", MessageBoxButtons.OK, MessageBoxIcon.Information);

            // Reset
            //btnGenerate.Enabled = false;
            //clbFiles.Items.Clear();
            //clbFiles.Enabled = false;
            //txtPath.Text = null;
            //assembliesPath = null;

            AppDomain.CurrentDomain.AssemblyResolve -= CurrentDomain_AssemblyResolve;
        }