C# 4 and CLR Compatibility

此生再无相见时 提交于 2019-12-11 03:55:56

问题


Are all the additions to C# for version 4 (dynamic, code contracts etc) expected to run on the current .NET CLR, or is there a planned .NET upgrade as well?


回答1:


C# 4 will require the .NET 4.0 CLR.




回答2:


Well, .NET 4.0 will require CLR 4.0; however, it is a little harder to answer what parts of C# 4.0 will work on .NET 2.0/3.x. We can hope that VS2010 will still be multi-targeting(I don't have the CTP "on me" so to speak, so I can't check...). But some of the language features don't seem hugely tied to the runtime (named parameters, some of the COM changes such as "ref") - so I can't think of a good reason why they wouldn't be available when talking to .NET 2.0/3.x. I haven't checked, though.

However, as with C# 3.0, some of the features are tied to the runtime - in particular dynamic.

I need to dig out the CTP and have another play, methinks...




回答3:


You don't have to wait for 4.0 to use Code Contracts as it runs on .NET 3.5, the download link for the academic preview release is here.



来源:https://stackoverflow.com/questions/336138/c-sharp-4-and-clr-compatibility

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!