Help with very basic c#
hi, im following a very basic tutorial on c# and i have to write the command Console.Windowheight = 20; but when i do i get this error: This call site is reachable on all platforms. 'Console.WindowHeight.set' is only supported on: 'windows'.
does anyone know a solution? (im using vscode)
thx in advance
5 Replies
Looks like your tutorial is a little old
In your .csproj, find the
<TargetFramework>
element, and add -windows
onto the end of the value. So e.g. if it's <TargetFramework>net8</TargetFramework>
, change it to <TargetFramework>net8-windows</TargetFramework>
Then it'll only run on Windows, but then Console.WindowHeight
only works on Windows
Also, we recommend using VS rather than VS Code. VS Code support for C# is still somewhat jankyouch, i don't get an error anymore on the Console.WindowHeight line, but when i debug the window stays the same size :\
Unknown User•4mo ago
Message Not Public
Sign In & Join Server To View
i tried using it and it didn't work.. i probably messed up somewhere tho since i'm at my beginning stage of learning
Unknown User•4mo ago
Message Not Public
Sign In & Join Server To View