dno*_*ord 4 .net multitargeting visual-studio-2008 visual-studio .net-2.0
我有一个VS2005解决方案,想要在新的一年里下VS2005.我对升级过程感到非常满意,并且惊喜地看到我的构建脚本大部分仍然有效.
我的问题是围绕多目标功能 - 我没有在我的服务器上安装.NET 3.5,所以我必须继续以.NET 2.0为目标.这主要是有效的,但我发现我可以做的事情
var returnMe = "result: " + result.ToString();
Run Code Online (Sandbox Code Playgroud)
...并且仍然成功调试项目.
当我将代码添加到构建服务器时,构建失败,说没有定义"var".
那么,我应该期待哪一个?
有任何想法吗?
The problem appears to be that the build server does not have the right compiler. You can build it on your workstation, right?
Many of the .NET 3.0 "features" are just syntax bits that revert to CLR 2 code at compile time. var
is one of them -- when it compiles, the compiler converts var to the appropriate type.
There is a pretty informative post on this at http://weblogs.asp.net/shahar/archive/2008/01/23/use-c-3-features-from-c-2-and-net-2-0-code.aspx
归档时间: |
|
查看次数: |
238 次 |
最近记录: |