468,541 Members | 1,766 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,541 developers. It's quick & easy.

Warning Msg: Name '_ClassColumn' is not CLS-compliant.

I converted a vb.1.1 web service project to 2.0 and .net 2.0 created /
replace some datasets. The code it automatiacly generated gets a warning
message as follows:

Warning 150 Name '_ClassColumn' is not CLS-compliant.
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temp orary ASP.NET
Files\wsvipn2006\4b065968\dadaeae0\Sources_App_Cod e\wsvipn2006.dsuser.xsd.8a6308fa.vb
2606 38 http://localhost/wsVIPN2006/

I'm trying to go through all my projects and to resolve all warnings after
converting to 2.0. How can I resolve this with out corrupting things?

--
mo*******@nospam.nospam
Dec 19 '05 #1
10 5851
Hi moondaddy,

If you double click on the warning, which line of code does the stops on?
Could you paste that part of code here?

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."

Dec 20 '05 #2
<System.Diagnostics.DebuggerNonUserCodeAttribute() > _ Public ReadOnly
Property _RegionColumn() As System.Data.DataColumn
Get
Return Me.column_Region
End Get
End Property

And here's the corisponding warning

Warning 151 Name '_RegionColumn' is not CLS-compliant.
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temp orary ASP.NET
Files\wsvipn2006\4b065968\dadaeae0\Sources_App_Cod e\wsvipn2006.dsuser.xsd.8a
6308fa.vb 2620 38 http://localhost/wsVIPN2006/

Thanks.

--
mo*******@nospam.nospam
"Kevin Yu [MSFT]" <v-****@online.microsoft.com> wrote in message
news:iF*************@TK2MSFTNGXA02.phx.gbl...
Hi moondaddy,

If you double click on the warning, which line of code does the stops on?
Could you paste that part of code here?

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."

Dec 20 '05 #3
Moondaddy,

It can be that the code is created first as C#.

Have a look if the column_Region is maybe public/friend declared with the
same name somewhere but with an other upper/lower case. This is allowed in
C# but is not CLS compliant.

I hope this helps,

Cor
Dec 20 '05 #4
"moondaddy" <mo*******@nospam.nospam> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...
I converted a vb.1.1 web service project to 2.0 and .net 2.0 created /
replace some datasets. The code it automatiacly generated gets a warning
message as follows:

Warning 150 Name '_ClassColumn' is not CLS-compliant.
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temp orary ASP.NET
Files\wsvipn2006\4b065968\dadaeae0\Sources_App_Cod e\wsvipn2006.dsuser.xsd.8a6308fa.vb
2606 38 http://localhost/wsVIPN2006/

I'm trying to go through all my projects and to resolve all warnings after
converting to 2.0. How can I resolve this with out corrupting things?

I had a similar problem when upgrading. I'm not sure I understand what was
wrong completely, but it involved this line in my AssemblyInfo.vb file:

<Assembly: CLSCompliant(True)>

I decided to just delete the AssemblyInifo.vb file, since VB 2005 handles
this differently somehow(?). (New projects don't even have this file.) That
cleared up my problem. It seemed to me at the time maybe the default
CLSCompliant is False? (I never set it to True in my VB 2003 project, not
sure how it got that way.) I assume it is using some default when the
AssemblyInfo.vb is not present.

Maybe somebody more in the know can clue me in.

It seems to me there is a bigger issue here. I assume we would want this
set to True. But I also assume leaving things at their defaults (by
removing AssemblyInfo.vb) should be OK also.

Thoughts anyone?

Greg
Dec 20 '05 #5
Hi Greg,

Please check Cor's post. The member of the class might be different in case
but with the same characters.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."

Dec 21 '05 #6
"Kevin Yu [MSFT]" <v-****@online.microsoft.com> wrote in message
news:eq**************@TK2MSFTNGXA02.phx.gbl...
Hi Greg,

Please check Cor's post. The member of the class might be different in
case
but with the same characters.


I took another look at my upgraded project.

I see AssemblyInfo.vb file is still alive and well. (I had forgotten it is
now a hidden file under the My Project folder).

By default (in VB 2005), this line is not present:
<Assembly: CLSCompliant(True)>

It was present in my VB 2003 project (and appears to be the default for new
2003 projects). If I add it back I get the below warnings. If I delete it,
or set it to false, the warnings go away.

warning BC40031: Name '_mainConnection' is not CLS-compliant.
warning BC40031: Name '_rowsAffected' is not CLS-compliant.
warning BC40031: Name '_errorCode' is not CLS-compliant.
warning BC40031: Name '_mainConnectionIsCreatedLocal' is not CLS-compliant.
warning BC40031: Name '_mainConnectionProvider' is not CLS-compliant.

I don't see anything in my code that would suggest I have a casing problem
with these variables as suggested by Cor.

What I did determine is that if I create ANY variables Public or Protected
(but not Private) whose names starts with an underscore I get the warning.

example:
Protected _foobar as Integer

So my questions are:

#1 Why is the default to have <Assembly: CLSCompliant(False)> (apparently,
since the line is not present in AssemblyInfo.vb) ?
#2 Why is the default different than 2003?
#3 How do you change this now in VS 2005 IDE without editing the
AssemblyInfo.vb file manually?
#4 What is the problem with the underscore _ character with Public
variables? (I think I know this one, but want to hear other opinions)

Greg
Dec 21 '05 #7
Hi Greg,

Thanks for the exact warning message. A programming element can contain one
or more underscores, but to be compliant with the Common Language
Specification (CLS), it must not begin with an underscore. See Declared
Element Names.

You can check the following link for more information on this warning.

http://msdn2.microsoft.com/en-us/library/k5645wwb.aspx

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."

Dec 22 '05 #8

Did you ever solve your 'is-compliant' issue because I'm receiving lots
of these warnings and even errors which should be warnings during my
conversion to 2005.

The leading underscore does not apply for me.

--
gaugdogg
------------------------------------------------------------------------
Posted via http://www.mcse.ms
------------------------------------------------------------------------
View this thread: http://www.mcse.ms/message2034812.html

Mar 15 '06 #9
I too have had naming problems related to conversion from 2003, where xsd
names were modified with underscore underscores inserted preceding the column
names. Apparently there is a compatibility issue here between 2003 and 2005.
If the Assembly.vb is modified what impact does that have in anything we do
with the project?
--
Thanks,
StanD
"moondaddy" wrote:
I converted a vb.1.1 web service project to 2.0 and .net 2.0 created /
replace some datasets. The code it automatiacly generated gets a warning
message as follows:

Warning 150 Name '_ClassColumn' is not CLS-compliant.
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temp orary ASP.NET
Files\wsvipn2006\4b065968\dadaeae0\Sources_App_Cod e\wsvipn2006.dsuser.xsd.8a6308fa.vb
2606 38 http://localhost/wsVIPN2006/

I'm trying to go through all my projects and to resolve all warnings after
converting to 2.0. How can I resolve this with out corrupting things?

--
mo*******@nospam.nospam

May 29 '06 #10
Hi Kevin,
I realize that I am responding to an early thread. but I would like some
guidance here.
I did not prefix my database column names, the 2003 ide was responsible.
There is apparently some incompatability issue with 2005. There were
mentioned that setting entry in the Assemblyinfo.vb to false would eliminate
the problem. Since this parameter was set false in vs2003, what are the
implications of setting this parameter false in vs2005?
--
Thanks,
StanD
"Kevin Yu [MSFT]" wrote:
Hi Greg,

Thanks for the exact warning message. A programming element can contain one
or more underscores, but to be compliant with the Common Language
Specification (CLS), it must not begin with an underscore. See Declared
Element Names.

You can check the following link for more information on this warning.

http://msdn2.microsoft.com/en-us/library/k5645wwb.aspx

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."

May 30 '06 #11

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Koen Van Herck | last post: by
12 posts views Thread by Fred Pacquier | last post: by
1 post views Thread by Shapper | last post: by
2 posts views Thread by ray well | last post: by
5 posts views Thread by nasse | last post: by
5 posts views Thread by Cubicle Intern | last post: by
reply views Thread by NPC403 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.