dotnet/roslyn

Usage of the variable Args in a C# script file is marked as error

Offen

#37.376 geöffnet am 19.07.2019

 (1 Kommentar) (0 Reaktionen) (1 zugewiesene Person)C# (4.257 Forks)batch import
Area-InteractiveBugDeveloper CommunityInteractive-ScriptingIDERegressionhelp wanted

Repository-Metriken

Stars
 (20.414 Sterne)
PR-Merge-Metriken
 (Durchschn. Merge 6T 17h) (256 gemergte PRs in 30 T)

Beschreibung

  • Create a CSX script file which uses the global Args variable to access command line parameters, e.g.
    Console.WriteLine(Args[0]);
    
  • Running it with csi is fine and shows the expected ouput
  • Add the file to a solution and edit it in Visual Studio
  • In the editor, all occurences of Args are underlined red because "the variable args is not available in the current context", which is obviously false
  • In Visual Studi 2017 editing the same script file did not procuce this annoying error message.

This issue has been moved from https://developercommunity.visualstudio.com/content/problem/548537/usage-of-the-variable-args-in-a-c-script-file-is-m.html VSTS ticketId: 857005 These are the original issue comments:

Visual Studio Feedback System on 4/27/2019, 10:54 PM (82 days ago): We have directed your feedback to the appropriate engineering team for further evaluation. The team will review the feedback and notify you about the next steps.

These are the original issue solutions: (no solutions)

Contributor Guide