"Technology Foundations" was retired on January 6, 2020.

Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

C# C# Basics Methods Defining a Method

Having issues with "*unsupported*" "Preview" error within the C# Basics course

Program.cs(11,9): error CS8652: The feature 'static local functions' is currently in Preview and unsupported.

Program.cs
using System;

class Program
{

    // YOUR CODE HERE: Define a method named Spell. Remember to use the
    // "static" and "void" keywords: "static void Spell" (without quotes)...

    static void Main(string[] args)
    {
        static void Spell()
        {
            Console.WriteLine("c");
            Console.WriteLine("a");
            Console.WriteLine("t");
        }
    }
}

2 Answers

Steven Parker
Steven Parker
231,236 Points

The new method should be defined outside of the "Main" method (but still within the class). Presumably, the new code would be added right after the "YOUR CODE HERE" comment lines.

The provided "Main" method should not be modified.

Thank you!