无法在类库中包含"VAR"隐式类型的变量 [英] unable to include'VAR' implicitly typed variable in Class Library

查看:111
本文介绍了无法在类库中包含"VAR"隐式类型的变量的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

无法在类库中包含隐含类型变量的"VAR".错误显示找不到类型或名称空间名称"var"(您是否缺少using指令或程序集引用?)". :)

重建步骤:
1)导入新的类库,在类内写入"VAR"变量.
2)声明命名空间
使用系统;
使用System.Collections.Generic;
使用System.Linq;
使用System.Data.Linq;

请咨询朋友.:confused:

Unable to include ''VAR'' implicitly typed variable in Class Library. Getting "The type or namespace name ''var'' could not be found (are you missing a using directive or an assembly reference?)" error. :)

Steps to recreate:
1)Import new Class Library.write the ''VAR'' variable inside the class.
2)Namespace declared
using System;
using System.Collections.Generic;
using System.Linq;
using System.Data.Linq;

Please advice friends.:confused:

推荐答案

var仅可在方法/属性内使用.换句话说,你不能从...嗯...那里到达那里.
var can only be used inside a method/property. In other words, you can''t get there from... ummm... there.


这篇关于无法在类库中包含"VAR"隐式类型的变量的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆