smurthys,
@smurthys@hachyderm.io avatar

I have written C# top-level code before, but I'm obviously suffering a "brain freeze" right now: Why does this simple top-level C# statement say "The name 'Console' does not exist in this context", even though I'm compiling with .NET 7.x and .NET 8 (well past .NET 5 that top-level statements need)? 😳

Console.WriteLine("hello world"); //System.Console works

.NET 8: https://dotnetfiddle.net/aAPvYU
.NET 7.0.105: https://sigcpp.godbolt.org/z/3v3Y1Ecbn

Someone, please, set me right. 🥺🙏🏽

  • All
  • Subscribed
  • Moderated
  • Favorites
  • CSharp
  • ngwrru68w68
  • rosin
  • GTA5RPClips
  • osvaldo12
  • love
  • Youngstown
  • slotface
  • khanakhh
  • everett
  • kavyap
  • mdbf
  • DreamBathrooms
  • thenastyranch
  • magazineikmin
  • megavids
  • InstantRegret
  • normalnudes
  • tacticalgear
  • cubers
  • ethstaker
  • modclub
  • cisconetworking
  • Durango
  • anitta
  • Leos
  • tester
  • provamag3
  • JUstTest
  • All magazines