|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
not CLS-compliantHi
After importing my vs 2003 project into vs 2005 I am getting the error Name '_DateColumn' is not CLS-compliant. on the second line of below code; <System.Diagnostics.DebuggerNonUserCodeAttribute()> _ Public ReadOnly Property _DateColumn() As System.Data.DataColumn Get Return Me.column_Date End Get End Property What does that mean and how can I fix it? I suspect this code was generated by vs 2003 itself. Regards
Show quote
Hide quote
"John" <John@nospam.infovis.co.uk> wrote in message I suspect it's the underscore.news:OJXMZ4DOHHA.5064@TK2MSFTNGP04.phx.gbl... > Hi > > After importing my vs 2003 project into vs 2005 I am getting the error > Name '_DateColumn' is not CLS-compliant. on the second line of below code; > > <System.Diagnostics.DebuggerNonUserCodeAttribute()> _ > Public ReadOnly Property _DateColumn() As System.Data.DataColumn > Get > Return Me.column_Date > End Get > End Property > > What does that mean and how can I fix it? I suspect this code was > generated by vs 2003 itself. Michael "John" <John@nospam.infovis.co.uk> ha scritto nel messaggio not CLS Compliant means that the *public* declaration doesn't follows the > <System.Diagnostics.DebuggerNonUserCodeAttribute()> _ > Public ReadOnly Property _DateColumn() As System.Data.DataColumn > Get > Return Me.column_Date > End Get > End Property > > What does that mean and how can I fix it? I suspect this code was > generated by vs 2003 itself. CLR specifications. This means that another .Net language may not understand correctly that declaration if it uses your assembly as a reference. In this case I think that the use of "_" as a name of a public member is a bad practise.
Show quote
Hide quote
"John" <John@nospam.infovis.co.uk> wrote in message It's the underscore.news:OJXMZ4DOHHA.5064@TK2MSFTNGP04.phx.gbl... : : Hi : : After importing my vs 2003 project into vs 2005 I am getting the : error Name '_DateColumn' is not CLS-compliant. on the second line : of below code; : : <System.Diagnostics.DebuggerNonUserCodeAttribute()> _ : Public ReadOnly Property _DateColumn() As System.Data.DataColumn : Get : Return Me.column_Date : End Get : End Property : : What does that mean and how can I fix it? I suspect this code was : generated by vs 2003 itself. : : Regards http://msdn2.microsoft.com/en-us/library/k5645wwb.aspx It's due the the fact that there are C/C++ compilers for .Net. In these languages, names with leading underscore characters are reserved for the "implementation" under certain specific rules (I've seen "the implementation" defined as anything other than the code the programmer is writing, btw). It states in the SDK documentation regarding variable names in the C++ language: Use of two sequential underscore characters ( __ ) at the beginning of an identifier, or a single leading underscore followed by a capital letter, is reserved for C++ implementations in all scopes. You should avoid using one leading underscore followed by a lowercase letter for names with file scope because of possible conflicts with current or future reserved identifiers. Since VB is not case sensitive, "_DateColumn" and "_dateColumn" are identical. However, in C/C++/C# they are not. The first version of the name is not legal in C++ but the second version is (although discouraged). Since VB doesn't differentiate by case, neither version is considered CLS compliant. Ralf -- -- ---------------------------------------------------------- * ^~^ ^~^ * * _ {~ ~} {~ ~} _ * * /_``>*< >*<''_\ * * (\--_)++) (++(_--/) * ---------------------------------------------------------- There are no advanced students in Aikido - there are only competent beginners. There are no advanced techniques - only the correct application of basic principles.
Copying to the clipboard
breaking up a String into an array of chars and adding to datatable Option Strict issue loading variable with AutoNumber field value after insert? Menu - Eliminate The Triangular Arror pointer thing - How to do it? Network Communications Programmatically modifying the controls in FormView's PagerTemplate Passing parameter to windows service... Logical Mistake Hide property at runtime. |
|||||||||||||||||||||||