New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VS2019 thinks `int Main` is unused #31572

Closed
yaakov-h opened this Issue Dec 6, 2018 · 1 comment

Comments

Projects
None yet
5 participants
@yaakov-h

yaakov-h commented Dec 6, 2018

Version Used:

Microsoft Visual Studio Enterprise 2019 Preview
Version 16.0.0 Preview 1.0

Steps to Reproduce:

  1. Create a new .NET Core console project
  2. Possibly unrelated, but set language version to 8.0 and enable NRT with <NullableReferenceTypes>true</NullableReferenceTypes> in the csproj.
  3. Build the following code:
using System;

namespace ConsoleApp1
{
    class Program
    {
        static int Main(string[] args)
        {
            if (args.Length == 0)
            {
                Console.WriteLine("Usage: ConsoleApp1 <text>");
                return -1;
            }

            foreach (var arg in args)
            {
                Console.WriteLine(arg);
            }
            return 0;
        }
    }
}

Expected Behavior:

No diagnostics

Actual Behavior:

IDE0051 Private member 'Program.Main' is unused.

@CyrusNajmabadi

This comment has been minimized.

Contributor

CyrusNajmabadi commented Dec 6, 2018

Tagging @mavasani

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment