Visual Basic 9.0不支持自动实现的属性。 [英] Visual Basic 9.0 does not support auto-implemented properties.

查看:159
本文介绍了Visual Basic 9.0不支持自动实现的属性。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在构建我的项目时遇到上述错误。

.net框架是2.0

web.config



< compilation debug =truestrict =falseexplicit =truetargetframework =4.0>







提前感谢!

解决方案

自动实现的属性是在.NET 4.0中引入VB的,并不可用为较低版本构建的项目。您将需要至少使用VS2010,并以.NET Framework 4.0或更高版本为目标来使用它们。


只需明确定义显式 >后备存储,可以是类/结构的实例字段。例如,请参阅 http://www.dotnetperls.com/property-vbnet [ ^ ]。



-SA

im getting above error when im tring to build my project.
.net framework is 2.0
web.config

<compilation debug="true" strict="false" explicit="true" targetframework="4.0">



thanks in advance!

解决方案

Auto-implemented properties were introduced to VB at .NET 4.0, and are not available projects built for lower versions. You will need to use at least VS2010, and target .NET framework 4.0 or above to use them.


Just implement the property explicitly, with explicitly defined backing store, which can be an instance field of a class/structure. See, for example, http://www.dotnetperls.com/property-vbnet[^].

—SA


这篇关于Visual Basic 9.0不支持自动实现的属性。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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