使用 Roslyn 编译器的解决方法 visual studio 2013 "understand"
Workaround with Roslyn compiler such that visual studio 2013 "understand"
据我所知,我可以在较低的 .NET 框架上将 C#6.0 代码编译为 运行,
Post-Answered Note: I realized that the post above only shows that C#6.0 can compile
on .NET 4.0. For lower .NET, here is the answer from Mr. Jason
Malinowski, who works on the Roslyn project:
"I can't think of a reason why it wouldn't work, but I'm not sure how
much that has been tested"
我在 Visual Studio 2013 年学习了如何使用 C#6.0 进行编码,并且阅读了一些有关该主题的帖子:
- How to enable C# 6.0 feature in Visual Studio 2013?
- How can I add C# 6.0 to Visual Studio 2013?
还有看视频:
我从他们那里基本了解到的是:
- 您可以使用 Roslyn 编译器在 VS2013 中启用 C#6.0 功能
- 您可以使用
Microsoft.Net.Compilers NuGet package
来使用 Roslyn 编译器,但是 VS2013 本身不会 "understand" 一些代码,因为 VS2013 的内部"live" 编译器与 Roslyn 不同。
- 从前有这样的支持。 https://github.com/dotnet/roslyn 但最新版本是四月末。
(附带问题:我的理解有什么问题吗?)
现在我的问题是:
- 截至目前,是否有一种方法可以解决
Microsoft.Net.Compilers NuGet package
和 VS2013 内部 "live" 编译器,使其可以 "understand" C#6.0?
"There was once upon a time where such is supported"
怎样才能拿到这个项目。当我从 github 下载项目并尝试使用 VS2013 打开它时,出现以下错误:
我们还能在 VS2013 中使用 April's End 版本吗,它会理解它试图编译的内容?
还有其他解决方法吗?只要我能用 C#6 编码,使用 VS2013,并将它编译到较低的 .NET 框架,我会很高兴。
谢谢!
注意:很遗憾,我无法使用 Visual Studio 2015...
总结兼容性和不兼容性:
- C# 6.0(语言)可以 用于编译 运行 .NET 4.0 的应用程序;即它不需要 .NET 4.5 或更高版本。
- 没有支持的方法 使 Visual Studio 2013 理解 IDE 中的 C# 6.0 代码。如您所见,我们确实在 Visual Studio 2013 年发布了 运行 6.0 之前版本的预览。这些只是在我们完成制作 Visual Studio 2015 的所有工作时作为预览。
- 您可以安装 NuGet 包以使构建在 Visual Studio 2013 下使用 C# 6.0,但 IDE 仍将 不了解C#6.0的特性和Intellisense的朋友会被打断
- 要构建 Roslyn 源代码 as-is(以及撰写本文时),您需要 Visual Studio 2015 with Update 1,或用于 Mac/Linux.
据我所知,我可以在较低的 .NET 框架上将 C#6.0 代码编译为 运行,
Post-Answered Note: I realized that the post above only shows that C#6.0 can compile on .NET 4.0. For lower .NET, here is the answer from Mr. Jason Malinowski, who works on the Roslyn project:
"I can't think of a reason why it wouldn't work, but I'm not sure how much that has been tested"
我在 Visual Studio 2013 年学习了如何使用 C#6.0 进行编码,并且阅读了一些有关该主题的帖子:
- How to enable C# 6.0 feature in Visual Studio 2013?
- How can I add C# 6.0 to Visual Studio 2013?
还有看视频:
我从他们那里基本了解到的是:
- 您可以使用 Roslyn 编译器在 VS2013 中启用 C#6.0 功能
- 您可以使用
Microsoft.Net.Compilers NuGet package
来使用 Roslyn 编译器,但是 VS2013 本身不会 "understand" 一些代码,因为 VS2013 的内部"live" 编译器与 Roslyn 不同。 - 从前有这样的支持。 https://github.com/dotnet/roslyn 但最新版本是四月末。
(附带问题:我的理解有什么问题吗?)
现在我的问题是:
- 截至目前,是否有一种方法可以解决
Microsoft.Net.Compilers NuGet package
和 VS2013 内部 "live" 编译器,使其可以 "understand" C#6.0? "There was once upon a time where such is supported"
怎样才能拿到这个项目。当我从 github 下载项目并尝试使用 VS2013 打开它时,出现以下错误:我们还能在 VS2013 中使用 April's End 版本吗,它会理解它试图编译的内容?
还有其他解决方法吗?只要我能用 C#6 编码,使用 VS2013,并将它编译到较低的 .NET 框架,我会很高兴。
谢谢!
注意:很遗憾,我无法使用 Visual Studio 2015...
总结兼容性和不兼容性:
- C# 6.0(语言)可以 用于编译 运行 .NET 4.0 的应用程序;即它不需要 .NET 4.5 或更高版本。
- 没有支持的方法 使 Visual Studio 2013 理解 IDE 中的 C# 6.0 代码。如您所见,我们确实在 Visual Studio 2013 年发布了 运行 6.0 之前版本的预览。这些只是在我们完成制作 Visual Studio 2015 的所有工作时作为预览。
- 您可以安装 NuGet 包以使构建在 Visual Studio 2013 下使用 C# 6.0,但 IDE 仍将 不了解C#6.0的特性和Intellisense的朋友会被打断
- 要构建 Roslyn 源代码 as-is(以及撰写本文时),您需要 Visual Studio 2015 with Update 1,或用于 Mac/Linux.