这是indexloc提供的服务,不要输入任何密码
Skip to content

Explore C# 6 - C# interactive C# tutorial : Error messages encountered when copying and pasting the code snippet #854

@jeryldev

Description

@jeryldev

Describe the bug

The following error messages are encountered when I copied and pasted the first code snippet provided in the "Explore C# 6 - C# interactive C# tutorial"

(1,1): error CS8652: The feature 'using declarations' is currently in Preview and unsupported. To use Preview features, use the 'preview' language version.
(1,7): error CS0118: 'System' is a namespace but is used like a type
(1,13): error CS0210: You must provide an initializer in a fixed or using statement declaration
(1,13): error CS1001: Identifier expected
(1,1): error CS1513: } expected
(27,14): error CS0542: 'Program': member names cannot be the same as their enclosing type

Did this error occur while using dotnet try or online?

  • [ x ] dotnet-try
  • [ x ] online

What kind of error was it?

  • [ x ] User Interface (UI): For example the output never displayed
  • Service Error: For example "The service is temporarily unavailable. We are working on it"
  • [ x ] Other:

(1,1): error CS8652: The feature 'using declarations' is currently in Preview and unsupported. To use Preview features, use the 'preview' language version.
(1,7): error CS0118: 'System' is a namespace but is used like a type
(1,13): error CS0210: You must provide an initializer in a fixed or using statement declaration
(1,13): error CS1001: Identifier expected
(1,1): error CS1513: } expected
(27,14): error CS0542: 'Program': member names cannot be the same as their enclosing type

Screenshots

Steps to reproduce:

  1. Navigate to https://docs.microsoft.com/en-us/dotnet/csharp/tutorials/exploration/csharp-6?tutorial-step=1
  2. Click Focus Mode
  3. Copy the first code snippet provided in the web page.
  4. Paste the code in the .NET editor

Actual Result:
image
(1,1): error CS8652: The feature 'using declarations' is currently in Preview and unsupported. To use Preview features, use the 'preview' language version.
(1,7): error CS0118: 'System' is a namespace but is used like a type
(1,13): error CS0210: You must provide an initializer in a fixed or using statement declaration
(1,13): error CS1001: Identifier expected
(1,1): error CS1513: } expected
(27,14): error CS0542: 'Program': member names cannot be the same as their enclosing type

Please complete the following:

  • OS
    • [ x ] Windows 10
    • macOS
    • Linux (Please specify distro)
    • iOS
    • Android
  • Browser
    • [ x ] Chrome
    • [ x ] Edge
    • Safari

Metadata

Metadata

Assignees

No one assigned

    Labels

    Notify docs.microsoft.comIssue has been acknowledged and the docs teams has been notifiedbugembedded UIIssues that occur in TDN embedded experiences. Please notify document owner

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions