S
steve bull
I have created a class with get/set methods but VS complains that the type of the variable is not CLS compliant. For example in the
following code :
namespace TilerSpace
{
public partial class TilerGoldenTriangleDEPanel : Form
{
public SwatchType PlusFilter
{
get
{
return scbxPlusDEColor.SwatchTypeList;
}
set
{
scbxPlusDEColor.SwatchTypeList = value;
}
} /* End of property PlusFilter */
}
I get a compiler warning "Type of PlusFilter is not CLS compliant".
SwatchType is a type declared in a seperate dll but included as a reference in the solution. Originally the dll was part of the
solution, though a separate project, and I didn't get this problem. Now having moved the code off to it's own dll I don't seem to be
able to get rid of the problem. Except, possibly, making it part of the solution again.
I could disable CLS compliance but I don't really want to do that. The application would always need to include the dll. Why should
this be a problem? I could include SwatchType variables in any other part of the code w/o getting a warning. Is there something
special about get/set or am I looking at this wrong way.
Thanks,
Steve
following code :
namespace TilerSpace
{
public partial class TilerGoldenTriangleDEPanel : Form
{
public SwatchType PlusFilter
{
get
{
return scbxPlusDEColor.SwatchTypeList;
}
set
{
scbxPlusDEColor.SwatchTypeList = value;
}
} /* End of property PlusFilter */
}
I get a compiler warning "Type of PlusFilter is not CLS compliant".
SwatchType is a type declared in a seperate dll but included as a reference in the solution. Originally the dll was part of the
solution, though a separate project, and I didn't get this problem. Now having moved the code off to it's own dll I don't seem to be
able to get rid of the problem. Except, possibly, making it part of the solution again.
I could disable CLS compliance but I don't really want to do that. The application would always need to include the dll. Why should
this be a problem? I could include SwatchType variables in any other part of the code w/o getting a warning. Is there something
special about get/set or am I looking at this wrong way.
Thanks,
Steve