VB.NET 自动实现的属性 - VS2010 和 VS2008 之间的兼容性
我正在开发一个 ASP.NET 项目,在 Visual Studio 2010 中使用 VB.NET。该项目的其他一些开发人员正在使用 Visual Studio 2008。我们都将代码签入单个 SVN 存储库。我想开始在 VB.NET 中使用自动实现的属性...
Property FirstName as String
而不是...
Private FirstName as String
Public Property FirstName() As String
Get
Return _FirstName
End Get
Set(ByVal value As String)
_FirstName = value
End Set
End Property
我担心这可能会给那些使用 VS2008 的人带来麻烦。如果使用 VS2008 的人需要修改我的使用自动实现属性的类,会发生什么情况?我假设由于所有内容都编译为 IL 代码,因此二进制兼容性不会有问题。虽然编辑源代码时会出现问题。我在这一点上是正确的还是错误的?谢谢。
I am working on an ASP.NET project where I use VB.NET within Visual Studio 2010. Some of the other developers on the project are using Visual Studio 2008. We all check our code into single SVN repository. I would like to start using Auto-Implemented Properties within VB.NET ...
Property FirstName as String
instead of ...
Private FirstName as String
Public Property FirstName() As String
Get
Return _FirstName
End Get
Set(ByVal value As String)
_FirstName = value
End Set
End Property
My concern is that this could mess up things for those using VS2008. What would happen if someone using VS2008 needed to modify my class that made use of Auto-Implemented Properties? I am assuming that since everything compiles down to IL code then there would be no issue in binary compatibility. Though a problem would arise when editing source. I am a correct or mistaken on this? Thank you.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
他们会得到一个编译错误
They will get a compilation error