Skip to content

C# 6 tutorial: missing require in nameof step #14226

Closed

Description

@DavidS

https://docs.microsoft.com/en-gb/dotnet/csharp/tutorials/exploration/csharp-6?tutorial-step=8 requires an additional require System.Collections.Generic to work:

file.cs(10,9): error CS0246: The type or namespace name 'List<>' could not be found (are you missing a using directive or an assembly reference?)
file.cs(10,34): error CS0246: The type or namespace name 'List<>' could not be found (are you missing a using directive or an assembly reference?)

Document details

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

Activity

  1. added 2 commits that reference this issue on Sep 5, 2019
    8d30940
    1c878b3
  2. added a commit that references this issue on Sep 5, 2019
    ef2a60d
  3. nemrism commented on Sep 5, 2019

    @nemrism
    Contributor

    @BillWagner, I just noticed that another step is missing a using:

    In the step 5, A better string format, in order to use the following code:
    var wordLength = from word in phrase.Split(" ") select word.Length;

    We should add the following using: using System.Linq

    How do you want to add this?

  4. BillWagner commented on Sep 5, 2019

    @BillWagner
    Member

    @nemrism I can do that. Or do you want to make a new PR?

  5. nemrism commented on Sep 5, 2019

    @nemrism
    Contributor

    I'll let you add it directly @BillWagner

    You'll also need to change the line of code to:
    var wordLength = from word in phrase.Split(' ') select word.Length;

    It doesn't compile with a string parameter in the C#interactive experience!

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions