try icon indicating copy to clipboard operation
try copied to clipboard

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

Open jeryldev opened this issue 5 years ago • 0 comments

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

jeryldev avatar Jul 07 '20 04:07 jeryldev