Top-level statements in MSVS
Say you've created a new project with top-level statements in MSVS. Is it possible to change it to not use top level statements after the project has been created?
12 Replies
Like say you leave "do not use top level statements" unticked in the above window during project creation
How can this setting be reversed for the individual project?
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View
Just add the boilerplate
It's not like it's a whole different project type
what about the other way around, where the setting is ticked and you want to avoid using the boilerplate after project creation?
Delete it
Just convert it by hand. It's a few LoC to add/delete. It's not a big deal.
it's just
but top level statements generates that boilerplate behind the scenes
So
Console.WriteLine("Hello World")
in a Top Level Statement project gets built as
(Plus the namespace)
Press ctrl+.
In the main method or on the top level statements
There is a refactoring to convert to/from
Oh, nice.
oh, this is native to msvs without resharper?
hmm, ctrl + isn't doing anything
ctrl + .
the dot matters