找不到类型或命名空间名称'var'(您是否缺少using指令或程序集引用?) [英] The type or namespace name 'var' could not be found (are you missing a using directive or an assembly reference?)
问题描述
大家好,
我收到错误,当我在项目中使用'var'关键字时,错误应该是这样的,但我不知道如何要解决这个问题,请帮助我,如果有任何人知道这个答案,给定的代码是我已经跟随我的项目...
var fromAddress =;
var toAddress =;
感谢提前......
var
(您似乎使用的是2.0)。
Var
是.net 3.5增强功能。你可能想查看你正在使用的.net版本。
祝你好运!
解决方案可能很简单:
string fromAddress = 跨度>;
string toAddress = ;
我知道当对象名称为时,我们尝试使用var
很长很复杂。
但我觉得很愚蠢,人们试图通过在任何地方使用var
关键字来打败C#语言的强类型方向。
hi all,
I got an error,when am using 'var' keyword in my project, the error should be like this, but i dont know how to resolve this problem, please help me if any one known this answer , the given code is i have follow in my project...
var fromAddress = "";
var toAddress = "";
thanks to advance...
var
was added in C# 3.0 (you seem to be using 2.0).
Var
is a .net 3.5 enhancement. You might want to check the .net version you are using.
Good luck!
Solution could be simple:
string fromAddress = ""; string toAddress = "";
I understand that we try to usevar
when object names are quite long and complicated.
But I find silly that people try to defeat the strongly-typed orientation of the C# language by usingvar
keyword anywhere.
这篇关于找不到类型或命名空间名称'var'(您是否缺少using指令或程序集引用?)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!