gpt4 book ai didi

c# - 如何在 Visual Studio 中创建 csx 文件?

转载 作者:行者123 更新时间:2023-12-05 08:56:57 26 4
gpt4 key购买 nike

我正在使用 Visual Studio 2015 Update 2。根据 csi.exe,有诸如“C# 脚本文件”之类的东西:

Executes script-file.csx if specified

是否有这种格式的文档?如何在 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.

最佳答案

我能够在 Visual Studio 2015 Update 2 中创建一个 C# 脚本 (.csx) 文件,方法是从 IDE 中创建一个文本文件并将其保存为 .csx 扩展名。然后,我可以通过右键单击并选择“在交互中执行”来在 C# Interactive (csi.exe) 中的 C# 脚本文件中执行 C# 代码。它确实运行了,但是没有智能感知支持。

关于c# - 如何在 Visual Studio 中创建 csx 文件?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36866654/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com