Как создать файл CSX в Visual Studio?

Я использую Visual Studio 2015 Update 2. Согласно csi.exe Есть такие вещи, как "файлы сценариев C#":

Выполняет script-file.csx, если указано

Есть ли документация для этого формата? Как я могу создать их в Visual Studio?


> csi.exe /?

Microsoft (R) Visual C# Interactive Compiler version 1.2.0.60317
Copyright (C) Microsoft Corporation. All rights reserved.

Usage: csi [option] ... [script-file.csx] [script-argument] ...

Executes script-file.csx if specified, otherwise launches an interactive REPL (Read Eval Print Loop).

Options:
  /help                          Display this usage message (alternative form: /?)
  /i                             Drop to REPL after executing the specified script.
  /r:<file>                      Reference metadata from the specified assembly file (alternative form: /reference)
  /r:<file list>                 Reference metadata from the specified assembly files (alternative form: /reference)
  /lib:<path list>               List of directories where to look for libraries specified by #r directive. 
                                 (alternative forms: /libPath /libPaths)
  /u:<namespace>                 Define global namespace using (alternative forms: /using, /usings, /import, /imports)
  @<file>                        Read response file for more options
  --                             Indicates that the remaining arguments should not be treated as options.

2 ответа

Решение

К сожалению, это невозможно. Об ошибке сообщили в Microsoft. Пожалуйста, добавьте свой голос. https://visualstudio.uservoice.com/forums/121579-visual-studio-2015/suggestions/7848117-add-scriptcs-csx-intellisense-and-debugging-in-v

Мне удалось создать файл C# Script (.csx) в Visual Studio 2015 Update 2, создав текстовый файл из среды IDE и сохранив его с расширением.csx. Затем я смог выполнить код C# в файле C# Script в C# Interactive (csi.exe), щелкнув правой кнопкой мыши и выбрав "Выполнить в интерактиве". Это действительно бежало, однако не было никакой поддержки intellisense.

Другие вопросы по тегам