c# - TextTransform.exe 似乎只接受旧版本的 C#

标签 c# visual-studio command-line c#-3.0 t4

当我在 Visual Studio 内部扩展 T4 模板时,我可以使用完整的 C# 3.0 语法,包括 LINQ 表达式等。当我使用 TextTransform.exe 在 Visual Studio 外部扩展它时,它会提示 LINQ 表达式和 C# 3.0 的其他新功能。是否有较新版本的 TextTransform.exe?

我正在运行的那个位于:

C:\Program Files\Common Files\Microsoft Shared\TextTemplating\1.2\TextTransform.exe

最佳答案

1.2 是 Visual Studio 2008 附带的 TextTransform 版本。但是,除非您在 template 中指定版本 3.5,否则它将使用 C# 编译器版本 2.0。指示。 3.5 是 C# 3.0 编译器的 C# CodeDOM 提供程序的内部版本。

关于c# - TextTransform.exe 似乎只接受旧版本的 C#,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1669893/

相关文章:

c# - 用正则表达式分割

c++ - 适用于任何 pc 的 Visual Studio 2017 C++ Exe(链接 vcruntime140.dll)

asp.net - 如何将default.aspx设置为Visual Studio调试器的默认启动点?

php - 如何通过终端或其他方式将参数传递给 JavaScriptCore/Console?

C# SQL 选择汉字返回怪异字符

c# - 数据库连接不工作 - System.Data.SqlClient.SqlException : No process is on the other end of the pipe

c# - 如何使用 SemanticModel 检查变量是否已经过测试?

c++ - 使用 Visual Studio 在 C++ 应用程序中查找内存泄漏

command-line - 在 SWI Prolog 中使用命令提示符或使用 process_create/3 的 shell 时出错

git - 如何在 OS X 上将 FileMerge 作为 diff 工具与 git 进行管道传输?