Wie repariere ich C# Warnung CA1416 in VSCODE?

Post a reply

Smilies
:) :( :oops: :chelo: :roll: :wink: :muza: :sorry: :angel: :read: *x) :clever:
View more smilies

BBCode is ON
[img] is ON
[flash] is OFF
[url] is ON
Smilies are ON

Topic review
   

Expand view Topic review: Wie repariere ich C# Warnung CA1416 in VSCODE?

by Guest » 05 Feb 2025, 02:40

Ich fange gerade an, C# nach brackeys auf YouTube zu lernen. Beim Schreiben erhalte ich dieses Problem in VSCODE: < /p>

Code: Select all

{
"resource": "/d:/OneDrive/Programming/Youtube/brackeys/How To Program In C#/Basics/Program.cs",
"owner": "msCompile",
"code": "CA1416",
"severity": 4,
"message": "This call site is reachable on all platforms. 'Console.WindowHeight.set' is only supported on: 'windows'. [D:\\OneDrive\\Programming\\Youtube\\brackeys\\How To Program In C#\\Basics\\Basics.csproj]",
"startLineNumber": 11,
"startColumn": 13,
"endLineNumber": 11,
"endColumn": 13
}
< /code>
Ich habe diesen Microsoft -Artikel gefunden, der über diese Warnung gesprochen hat, aber ich verstehe die Lösung nicht, wenn es tatsächlich das ist: (... < /p>
I Haben Sie ein einfaches Programm, das nur etwas über die Konsolenklasse lernen Sie die Anschlusshöhe und Schriftfarbe usw.: < /p>
    using System;

namespace Basics
{
class Program
{
static void Main(string[] args)
{
Console.Title = "Skynet";
Console.ForegroundColor = ConsoleColor.Green;
Console.WindowHeight = 40;

Console.WriteLine();

Console.ReadKey();

}
}
}
Hat jemand eine Idee, wie man dieses Problem angeht?

Top