切换到 Visual Studio 2015 后,我们注意到 Roslyn 中 lambda 编译为 MSIL 的方式发生了一些变化(在 this thread 和 on GitHub 中描述)在某些情况下引入了运行时故障。
由于 Roslyn 显然是 .NET 的 future ,我们想切换到这项技术,但似乎所有在生产中运行的遗留代码(我们有相当程度的信心它可以正常工作)是现在容易出现新的运行时故障。这些库也受此问题影响(如 Moq, for example)。
我们已经跳过了升级到 RyuJIT 的 its issues ,但我相信 Visual Studio 2015 与 Roslyn 高度集成,我认为我们不能简单地手动替换 csc.exe
(但那是 a different question )。
那么,Roslyn 中是否有一个重大更改的汇编列表,我们可以引用它来了解我们可以期待什么?
最佳答案
(更新)
感谢@NealGafter 提供链接。目前可以在此处找到重大更改列表:
似乎有些文档应该在这里:Roslyn Compiler Specification (roslyn/docs/compilers on GitHub) .根据描述:
The compiler specification details the supported (and semi-supported) surface area of the Roslyn VB and C# compilers. This includes
- Command-line switches and their meaning
- Breaking changes from previous versions of the compilers
- Compiler behaviors that are (intentionally) contrary to the specification
- Compiler features not described by the language specification
- COM-specific and other Microsoft-specific features
- "Well-known" attributes that affect compiler behavior
- The "ruleset" file syntax and semantics
- Features included for interoperability between C# and VB, for example
- Named Indexers use from C#
- Places where the compiler behavior diverges from the language specification
- Limitations (e.g. identifier length)
- History of language changes per version
描述 CodeGen 关于 lambda 的更改的文档(因为这是我最初的问题)位于 roslyn/docs/compilers/CSharp/CodeGen Differences :
Non-lifting Lambda expressions are now implemented as instance methods on singleton display classes. Since the entry point to the delegate is the instance "Invoke" method, it is cheaper at runtime to dispatch delegate invocations to the underlying implementing method if such method is also an instance method with exactly same formal signature as "Invoke".
关于visual-studio-2015 - Roslyn 中的重大更改列表,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33954768/