Skip to content

C# 7.0 vs 7.1 #5366

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

Closed
JD-Sp opened this issue May 14, 2018 — with docs.microsoft.com · 7 comments · Fixed by #5333
Closed

C# 7.0 vs 7.1 #5366

JD-Sp opened this issue May 14, 2018 — with docs.microsoft.com · 7 comments · Fixed by #5333

Comments

Copy link

JD-Sp commented May 14, 2018

Maybe I'm just inexperienced, but it should probably be noted that you have to be running C# 7.1 for this in the pre-requisites.

I'm running 7, on VS for Mac 7.5, and it gave me a compiler warning about having an asynchronous Main method. Makes sense, but was surprised when I saw the compiler error.


Document Details

Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

@mairaw
Copy link
Contributor

mairaw commented May 14, 2018

Hi @JD-Sp, right now the tutorial is only focused on Visual Studio. So if we make the tutorial cross-plat, we should call out the right prerequisites. I assigned this issue to the author.

@BillWagner
Copy link
Member

@JD-Sp Thanks for pointing this out. It will run on .NET Core 2 from the command line (that has C# 7.1 installed.)

@pkulikov
Copy link
Contributor

@mairaw if I create .NET Core console app in Visual Studio (15.7) on Windows, the default C# version is 7.0 (I also have .NET Core 2 installed)
@BillWagner when I create the .NET Core 2 console app from the command line, that also defaults to C# 7.0.

Samples code has the language version specified explicitly, which is not default.

So, it would be nice to specify in console app creation section that C# language version should be updated to C#7.1 at least.

@JD-Sp
Copy link
Author

JD-Sp commented May 14, 2018

@pkulikov Same. I created a version using the CLI tools, and it defaulted to 7.

I did just go into and manually target 7.1 in the .csproj file, and it works running from the command line. There were a few tweaks to the code to make it cross platform, but all in all i got a good result.

@mairaw
Copy link
Contributor

mairaw commented May 14, 2018

I also noticed that our sample is set to netcoreapp2.1 which won't work with VS 15.6 AFAIK, which is the prereq version that we define on the topics. Should we bump up the VS version prereq or change TargetFramework of our sample in dotnet/samples to 2.0?

@BillWagner
Copy link
Member

The target framework should change to 2.0. (I built it on my machine where I was doing some preview work at the same time.)

@mairaw
Copy link
Contributor

mairaw commented May 14, 2018

Thanks @BillWagner. I'll make the change then.

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

Successfully merging a pull request may close this issue.

5 participants