PC Review


Reply
Thread Tools Rate Thread

CLS Compliance

 
 
=?Utf-8?B?Z3V5?=
Guest
Posts: n/a
 
      15th Feb 2006
I have a number of classes, none of which use non CLS Compliant data types.
These classes are compiled into an assembly.
however when using this assembly a function (for example) that returns one
of these classes gives a compiler warning "Return type of MyFunction is not
CLS compliant"
this occurs with every class in the assembly.

why is this?

--guy--
 
Reply With Quote
 
 
 
 
=?Utf-8?B?Z3V5?=
Guest
Posts: n/a
 
      15th Feb 2006
further to this, the project is VB2005, and has been upgraded from vb2003

"guy" wrote:

> I have a number of classes, none of which use non CLS Compliant data types.
> These classes are compiled into an assembly.
> however when using this assembly a function (for example) that returns one
> of these classes gives a compiler warning "Return type of MyFunction is not
> CLS compliant"
> this occurs with every class in the assembly.
>
> why is this?
>
> --guy--

 
Reply With Quote
 
=?Utf-8?B?Z3V5?=
Guest
Posts: n/a
 
      16th Feb 2006
got it!

its because the code is migrated vb2003!

if i create a new project and copy/paste the code in evertything is fine!

--guy--


"guy" wrote:

> further to this, the project is VB2005, and has been upgraded from vb2003
>
> "guy" wrote:
>
> > I have a number of classes, none of which use non CLS Compliant data types.
> > These classes are compiled into an assembly.
> > however when using this assembly a function (for example) that returns one
> > of these classes gives a compiler warning "Return type of MyFunction is not
> > CLS compliant"
> > this occurs with every class in the assembly.
> >
> > why is this?
> >
> > --guy--

 
Reply With Quote
 
ThunderMusic
Guest
Posts: n/a
 
      16th Feb 2006
hi,
can someone explain why? Is it documented somewhere? because I plan on
migrating much much much code from VB2003 to VB2005 in a near future, so I
want to know if it's normal behavior or if there are precise cases where it
does that...

Thanks

ThunderMusic

"guy" <(E-Mail Removed)> wrote in message
news:9D8609D4-E58C-4774-B69D-(E-Mail Removed)...
> got it!
>
> its because the code is migrated vb2003!
>
> if i create a new project and copy/paste the code in evertything is fine!
>
> --guy--
>
>
> "guy" wrote:
>
>> further to this, the project is VB2005, and has been upgraded from vb2003
>>
>> "guy" wrote:
>>
>> > I have a number of classes, none of which use non CLS Compliant data
>> > types.
>> > These classes are compiled into an assembly.
>> > however when using this assembly a function (for example) that returns
>> > one
>> > of these classes gives a compiler warning "Return type of MyFunction is
>> > not
>> > CLS compliant"
>> > this occurs with every class in the assembly.
>> >
>> > why is this?
>> >
>> > --guy--



 
Reply With Quote
 
=?Utf-8?B?Z3V5?=
Guest
Posts: n/a
 
      16th Feb 2006
Hi,
i cant explain it but...

Note The current Microsoft Visual Basic compiler intentionally does not
generate a CLS-compliance warning, however, a future release of the compiler
will issue that warning.

from:-
http://msdn.microsoft.com/library/de...classtopic.asp

wether this is significant i dont know.

basically what i did intitally was create a vb2005 project and add in a vb
2003 vb class file this project referenced some vb 2005 assemblies, all of
which then appeared as non cls compliant.

for the second attempt i created another vb2005 project, created an empty
class file and pasted in the code from the vb2003 class, then set up the
references and all was fine!

a colleague has experienced identical problems

it ***might*** be something to do with referncing the vb2005 assemblies, buy
i havent tried this.
looking at posts on the net this seems a common problem, but i havent seen
an explanation:-(

hth

---guy---

"ThunderMusic" wrote:

> hi,
> can someone explain why? Is it documented somewhere? because I plan on
> migrating much much much code from VB2003 to VB2005 in a near future, so I
> want to know if it's normal behavior or if there are precise cases where it
> does that...
>
> Thanks
>
> ThunderMusic
>
> "guy" <(E-Mail Removed)> wrote in message
> news:9D8609D4-E58C-4774-B69D-(E-Mail Removed)...
> > got it!
> >
> > its because the code is migrated vb2003!
> >
> > if i create a new project and copy/paste the code in evertything is fine!
> >
> > --guy--
> >
> >
> > "guy" wrote:
> >
> >> further to this, the project is VB2005, and has been upgraded from vb2003
> >>
> >> "guy" wrote:
> >>
> >> > I have a number of classes, none of which use non CLS Compliant data
> >> > types.
> >> > These classes are compiled into an assembly.
> >> > however when using this assembly a function (for example) that returns
> >> > one
> >> > of these classes gives a compiler warning "Return type of MyFunction is
> >> > not
> >> > CLS compliant"
> >> > this occurs with every class in the assembly.
> >> >
> >> > why is this?
> >> >
> >> > --guy--

>
>
>

 
Reply With Quote
 
ThunderMusic
Guest
Posts: n/a
 
      16th Feb 2006
thanks a lot... it will probably save me some time to know at least one way
to solve the problem.
"guy" <(E-Mail Removed)> wrote in message
news:49F246CA-7F78-4D82-BF0B-(E-Mail Removed)...
> Hi,
> i cant explain it but...
>
> Note The current Microsoft Visual Basic compiler intentionally does not
> generate a CLS-compliance warning, however, a future release of the
> compiler
> will issue that warning.
>
> from:-
> http://msdn.microsoft.com/library/de...classtopic.asp
>
> wether this is significant i dont know.
>
> basically what i did intitally was create a vb2005 project and add in a vb
> 2003 vb class file this project referenced some vb 2005 assemblies, all of
> which then appeared as non cls compliant.
>
> for the second attempt i created another vb2005 project, created an empty
> class file and pasted in the code from the vb2003 class, then set up the
> references and all was fine!
>
> a colleague has experienced identical problems
>
> it ***might*** be something to do with referncing the vb2005 assemblies,
> buy
> i havent tried this.
> looking at posts on the net this seems a common problem, but i havent seen
> an explanation:-(
>
> hth
>
> ---guy---
>
> "ThunderMusic" wrote:
>
>> hi,
>> can someone explain why? Is it documented somewhere? because I plan on
>> migrating much much much code from VB2003 to VB2005 in a near future, so
>> I
>> want to know if it's normal behavior or if there are precise cases where
>> it
>> does that...
>>
>> Thanks
>>
>> ThunderMusic
>>
>> "guy" <(E-Mail Removed)> wrote in message
>> news:9D8609D4-E58C-4774-B69D-(E-Mail Removed)...
>> > got it!
>> >
>> > its because the code is migrated vb2003!
>> >
>> > if i create a new project and copy/paste the code in evertything is
>> > fine!
>> >
>> > --guy--
>> >
>> >
>> > "guy" wrote:
>> >
>> >> further to this, the project is VB2005, and has been upgraded from
>> >> vb2003
>> >>
>> >> "guy" wrote:
>> >>
>> >> > I have a number of classes, none of which use non CLS Compliant data
>> >> > types.
>> >> > These classes are compiled into an assembly.
>> >> > however when using this assembly a function (for example) that
>> >> > returns
>> >> > one
>> >> > of these classes gives a compiler warning "Return type of MyFunction
>> >> > is
>> >> > not
>> >> > CLS compliant"
>> >> > this occurs with every class in the assembly.
>> >> >
>> >> > why is this?
>> >> >
>> >> > --guy--

>>
>>
>>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
PCI Compliance trosvold Windows XP Help 3 17th Jul 2009 03:24 AM
C2 compliance? Ham Pastrami Microsoft Windows 2000 4 11th Jul 2007 10:44 AM
.NET compliance Wozza Microsoft Dot NET 1 12th Oct 2006 06:02 PM
CLS compliance Lloyd Dupont Microsoft VC .NET 0 27th Aug 2006 04:18 PM
Non Compliance with CLS Gary Coutts Microsoft C# .NET 2 24th Mar 2004 10:20 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 04:53 AM.