Skip to content

Error CS0029 Cannot implicitly convert type 'CommandLine.ParserResult<Options>' to 'Options' #511

Closed
@Bluscream

Description

@Bluscream
using CommandLine;
using System;
using System.Windows.Forms;

namespace MWR_Config_Editor
{
    static class Program
    {
        private static readonly NLog.Logger Logger = NLog.LogManager.GetCurrentClassLogger();
        public static Options Arguments;
        public class Options
        {
            [Option('c', "console", Required = false, HelpText = "Enable console")]
            public bool Verbose { get; set; }
        }
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        [STAThread]
        static void Main(string[] args)
        {
            Logger.Debug("Program started");
            Arguments = Parser.Default.ParseArguments<Options>(args);
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new Main());
            Logger.Debug("Program ended");
        }
    }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions