By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,946 Members | 1,676 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,946 IT Pros & Developers. It's quick & easy.

Return type of function not CLS-compliant

P: n/a
Using VB.Net 2005.

I have my interfaces and enums defined in a DLL. For example, I have this
enum:
Public Enum OpStatusTypes
Normal
InProgress
Paused
End Enum
In another DLL I reference that DLL and expose a property based on the enum:

Public ReadOnly Property OpStatus() As OpStatusTypes
Get
Return m_OpStatus
End Get
End Property

The compiler gives me the subject warning -- why?
What concerns should I have about this?
'
--
Doug.

Aug 1 '07 #1
Share this Question
Share on Google+
8 Replies


P: n/a
Hey Doug,

I wouldn't worry about it. The underlying type is Int32 (implied)
And even if you used an unsigned int as the underlying type, which wouldn't
be CLS compliant, both VB and C# support them as of 2005.
"Douglas Marquardt" <Do**************@discussions.microsoft.comwrote in
message news:CC**********************************@microsof t.com...
Using VB.Net 2005.

I have my interfaces and enums defined in a DLL. For example, I have this
enum:
Public Enum OpStatusTypes
Normal
InProgress
Paused
End Enum
In another DLL I reference that DLL and expose a property based on the
enum:

Public ReadOnly Property OpStatus() As OpStatusTypes
Get
Return m_OpStatus
End Get
End Property

The compiler gives me the subject warning -- why?
What concerns should I have about this?
'
--
Doug.
Aug 1 '07 #2

P: n/a
"Bill McCarthy" <Bi**@NOSPAM.comschrieb:
I wouldn't worry about it. The underlying type is Int32 (implied)
And even if you used an unsigned int as the underlying type, which
wouldn't be CLS compliant, both VB and C# support them as of 2005.
I thought unsigned types became CLS compiliant since .NET 2.0.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>

Aug 1 '07 #3

P: n/a

"Herfried K. Wagner [MVP]" <hi***************@gmx.atwrote in message
news:eM**************@TK2MSFTNGP05.phx.gbl...
"Bill McCarthy" <Bi**@NOSPAM.comschrieb:
>I wouldn't worry about it. The underlying type is Int32 (implied)
And even if you used an unsigned int as the underlying type, which
wouldn't be CLS compliant, both VB and C# support them as of 2005.

I thought unsigned types became CLS compiliant since .NET 2.0.
Nope. Generics are, but UInt16, UInt32 and UInt64 remain non compliant.

Aug 1 '07 #4

P: n/a
Hi Bill:

Ok, so I won't worry about it -- it just bugs me that I am getting the
warning.

thx!

--
Doug.

"Bill McCarthy" wrote:
Hey Doug,

I wouldn't worry about it. The underlying type is Int32 (implied)
And even if you used an unsigned int as the underlying type, which wouldn't
be CLS compliant, both VB and C# support them as of 2005.
"Douglas Marquardt" <Do**************@discussions.microsoft.comwrote in
message news:CC**********************************@microsof t.com...
Using VB.Net 2005.

I have my interfaces and enums defined in a DLL. For example, I have this
enum:
Public Enum OpStatusTypes
Normal
InProgress
Paused
End Enum
In another DLL I reference that DLL and expose a property based on the
enum:

Public ReadOnly Property OpStatus() As OpStatusTypes
Get
Return m_OpStatus
End Get
End Property

The compiler gives me the subject warning -- why?
What concerns should I have about this?
'
--
Doug.
Aug 4 '07 #5

P: n/a
Hi Doug,

You shouldn't be if all assemblies are marked with CLS compliant. But yeh,
nothing to worry about anyway really ;)

"Douglas Marquardt" <Do**************@discussions.microsoft.comwrote in
message news:C6**********************************@microsof t.com...
Hi Bill:

Ok, so I won't worry about it -- it just bugs me that I am getting the
warning.

thx!

--
Doug.

"Bill McCarthy" wrote:
>Hey Doug,

I wouldn't worry about it. The underlying type is Int32 (implied)
And even if you used an unsigned int as the underlying type, which
wouldn't
be CLS compliant, both VB and C# support them as of 2005.
"Douglas Marquardt" <Do**************@discussions.microsoft.comwrote in
message news:CC**********************************@microsof t.com...
Using VB.Net 2005.

I have my interfaces and enums defined in a DLL. For example, I have
this
enum:
Public Enum OpStatusTypes
Normal
InProgress
Paused
End Enum
In another DLL I reference that DLL and expose a property based on the
enum:

Public ReadOnly Property OpStatus() As OpStatusTypes
Get
Return m_OpStatus
End Get
End Property

The compiler gives me the subject warning -- why?
What concerns should I have about this?
'
--
Doug.
Aug 6 '07 #6

P: n/a
Hi Bill:

"all assemblies are marked with CLS compliant"

I added this to the AssemblyInfo:

<Assembly: CLSCompliant(True)>

Is that what you mean?
--
Doug.

"Bill McCarthy" wrote:
Hi Doug,

You shouldn't be if all assemblies are marked with CLS compliant. But yeh,
nothing to worry about anyway really ;)

"Douglas Marquardt" <Do**************@discussions.microsoft.comwrote in
message news:C6**********************************@microsof t.com...
Hi Bill:

Ok, so I won't worry about it -- it just bugs me that I am getting the
warning.

thx!

--
Doug.

"Bill McCarthy" wrote:
Hey Doug,

I wouldn't worry about it. The underlying type is Int32 (implied)
And even if you used an unsigned int as the underlying type, which
wouldn't
be CLS compliant, both VB and C# support them as of 2005.
"Douglas Marquardt" <Do**************@discussions.microsoft.comwrote in
message news:CC**********************************@microsof t.com...
Using VB.Net 2005.

I have my interfaces and enums defined in a DLL. For example, I have
this
enum:
Public Enum OpStatusTypes
Normal
InProgress
Paused
End Enum
In another DLL I reference that DLL and expose a property based on the
enum:

Public ReadOnly Property OpStatus() As OpStatusTypes
Get
Return m_OpStatus
End Get
End Property

The compiler gives me the subject warning -- why?
What concerns should I have about this?
'
--
Doug.


Aug 7 '07 #7

P: n/a
Hi Doug,

Yep. And make sure the dll's you are referencing, especially the one that
contains the Enum is also marked with the same attribute
"Douglas Marquardt" <Do**************@discussions.microsoft.comwrote in
message news:6B**********************************@microsof t.com...
Hi Bill:

"all assemblies are marked with CLS compliant"

I added this to the AssemblyInfo:

<Assembly: CLSCompliant(True)>

Is that what you mean?
--
Doug.

"Bill McCarthy" wrote:
>Hi Doug,

You shouldn't be if all assemblies are marked with CLS compliant. But
yeh,
nothing to worry about anyway really ;)

"Douglas Marquardt" <Do**************@discussions.microsoft.comwrote in
message news:C6**********************************@microsof t.com...
Hi Bill:

Ok, so I won't worry about it -- it just bugs me that I am getting the
warning.

thx!

--
Doug.

"Bill McCarthy" wrote:

Hey Doug,

I wouldn't worry about it. The underlying type is Int32 (implied)
And even if you used an unsigned int as the underlying type, which
wouldn't
be CLS compliant, both VB and C# support them as of 2005.
"Douglas Marquardt" <Do**************@discussions.microsoft.comwrote
in
message news:CC**********************************@microsof t.com...
Using VB.Net 2005.

I have my interfaces and enums defined in a DLL. For example, I
have
this
enum:
Public Enum OpStatusTypes
Normal
InProgress
Paused
End Enum
In another DLL I reference that DLL and expose a property based on
the
enum:

Public ReadOnly Property OpStatus() As OpStatusTypes
Get
Return m_OpStatus
End Get
End Property

The compiler gives me the subject warning -- why?
What concerns should I have about this?
'
--
Doug.


Aug 7 '07 #8

P: n/a
Will Do, thanks!

--
Doug.

"Bill McCarthy" wrote:
Hi Doug,

Yep. And make sure the dll's you are referencing, especially the one that
contains the Enum is also marked with the same attribute
"Douglas Marquardt" <Do**************@discussions.microsoft.comwrote in
message news:6B**********************************@microsof t.com...
Hi Bill:

"all assemblies are marked with CLS compliant"

I added this to the AssemblyInfo:

<Assembly: CLSCompliant(True)>

Is that what you mean?
--
Doug.

"Bill McCarthy" wrote:
Hi Doug,

You shouldn't be if all assemblies are marked with CLS compliant. But
yeh,
nothing to worry about anyway really ;)

"Douglas Marquardt" <Do**************@discussions.microsoft.comwrote in
message news:C6**********************************@microsof t.com...
Hi Bill:

Ok, so I won't worry about it -- it just bugs me that I am getting the
warning.

thx!

--
Doug.

"Bill McCarthy" wrote:

Hey Doug,

I wouldn't worry about it. The underlying type is Int32 (implied)
And even if you used an unsigned int as the underlying type, which
wouldn't
be CLS compliant, both VB and C# support them as of 2005.
"Douglas Marquardt" <Do**************@discussions.microsoft.comwrote
in
message news:CC**********************************@microsof t.com...
Using VB.Net 2005.

I have my interfaces and enums defined in a DLL. For example, I
have
this
enum:
Public Enum OpStatusTypes
Normal
InProgress
Paused
End Enum
In another DLL I reference that DLL and expose a property based on
the
enum:

Public ReadOnly Property OpStatus() As OpStatusTypes
Get
Return m_OpStatus
End Get
End Property

The compiler gives me the subject warning -- why?
What concerns should I have about this?
'
--
Doug.

Aug 8 '07 #9

This discussion thread is closed

Replies have been disabled for this discussion.