IL and case-sensitivity

Quoted from A Brief Introduction To IL code, CLR, CTS, CLS and JIT In .NET

CLS stands for Common Language Specifications. It is a subset of CTS.
CLS is a set of rules or guidelines which if followed ensures that
code written in one .NET language can be used by another .NET
language. For example one rule is that we cannot have member functions
with same name with case difference only i.e we should not have add()
and Add(). This may work in C# because it is case-sensitive but if try
to use that C# code in VB.NET, it is not possible because VB.NET is
not case-sensitive.

Based on above text I want to confirm two points here:

  1. Does the case-sensitivity of IL is a condition for member functions only, and not for member properties?
  2. Is it true that C# wouldn’t be inter-operable with VB.NET if it didn’t take care of the case sensitivity?

2

The restriction on case-sensitivity applies to all members (fields, methods, properties) visible to other assemblies. Thus, the following is OK:

[CLSCompliant(true)]
public class C
{
    private int i;
    public int I { get { return i; } set { i = value; } }
}

but the following isn’t:

[CLSCompliant(true)]
public class C
{
    public int i;
    public int I { get { return i; } set { i = value; } }
}

and the following isn’t either:

[CLSCompliant(true)]
public class C
{
    protected int i;
    public int I { get { return i; } set { i = value; } }
}

since a VB.NET class might want to inherit from class C.


If the second example above were in a C# library and a VB.NET project would try to use it, the following code would not compile:

Dim c As New C()
Console.WriteLine(c.I)

This is the compile-time error that the VB.NET compiler would throw:

‘I’ is ambiguous because multiple kinds of members with this name exist in class ‘C’.

Does the case-sensitivity of IL is a condition for member functions only, and not for member properties?

C# properties are implemented internally as special methods called accessors so the above quote applies to both methods and properties.

Is it true that C# wouldn’t be inter-operable with VB.NET if it didn’t take care of the case sensitivity?

Theoretically, it may be possible to write C# that is compatible with VB.NET. However, it is not just case sensitivity. For example, the many keywords appear in one language and not the other need special syntax (which C# and VB.NET both provide). Unsigned types cannot be exposed and operators cannot be overloaded. For more details, see https://stackoverflow.com/questions/570452/what-is-the-clscompliant-attribute-in-net.

Rather than manually having to check these, Microsoft created CLS as a way of programmaticly enforcing it. More importantly, it also allows languages other than VB.NET and C# to interoperate through a common runtime, including hose that lack a special syntax for invalid identifiers.

4

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa

IL and case-sensitivity

Quoted from A Brief Introduction To IL code, CLR, CTS, CLS and JIT In .NET

CLS stands for Common Language Specifications. It is a subset of CTS.
CLS is a set of rules or guidelines which if followed ensures that
code written in one .NET language can be used by another .NET
language. For example one rule is that we cannot have member functions
with same name with case difference only i.e we should not have add()
and Add(). This may work in C# because it is case-sensitive but if try
to use that C# code in VB.NET, it is not possible because VB.NET is
not case-sensitive.

Based on above text I want to confirm two points here:

  1. Does the case-sensitivity of IL is a condition for member functions only, and not for member properties?
  2. Is it true that C# wouldn’t be inter-operable with VB.NET if it didn’t take care of the case sensitivity?

2

The restriction on case-sensitivity applies to all members (fields, methods, properties) visible to other assemblies. Thus, the following is OK:

[CLSCompliant(true)]
public class C
{
    private int i;
    public int I { get { return i; } set { i = value; } }
}

but the following isn’t:

[CLSCompliant(true)]
public class C
{
    public int i;
    public int I { get { return i; } set { i = value; } }
}

and the following isn’t either:

[CLSCompliant(true)]
public class C
{
    protected int i;
    public int I { get { return i; } set { i = value; } }
}

since a VB.NET class might want to inherit from class C.


If the second example above were in a C# library and a VB.NET project would try to use it, the following code would not compile:

Dim c As New C()
Console.WriteLine(c.I)

This is the compile-time error that the VB.NET compiler would throw:

‘I’ is ambiguous because multiple kinds of members with this name exist in class ‘C’.

Does the case-sensitivity of IL is a condition for member functions only, and not for member properties?

C# properties are implemented internally as special methods called accessors so the above quote applies to both methods and properties.

Is it true that C# wouldn’t be inter-operable with VB.NET if it didn’t take care of the case sensitivity?

Theoretically, it may be possible to write C# that is compatible with VB.NET. However, it is not just case sensitivity. For example, the many keywords appear in one language and not the other need special syntax (which C# and VB.NET both provide). Unsigned types cannot be exposed and operators cannot be overloaded. For more details, see https://stackoverflow.com/questions/570452/what-is-the-clscompliant-attribute-in-net.

Rather than manually having to check these, Microsoft created CLS as a way of programmaticly enforcing it. More importantly, it also allows languages other than VB.NET and C# to interoperate through a common runtime, including hose that lack a special syntax for invalid identifiers.

4

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật