Click to Rate and Give Feedback
MSDN
MSDN Library
Visual Studio 2008
Visual Studio
Visual C#
C# Reference
 Compiler Error CS0698

  Switch on low bandwidth view
This page is specific to
Microsoft Visual Studio 2008/.NET Framework 3.5

Other versions are also available for the following:
Visual C# Reference: Errors and Warnings
Compiler Error CS0698

Error Message

A generic type cannot derive from 'class' because it is an attribute class

Any class that derives from an attribute class is an attribute. Attributes are not allowed to be generic types.

The following sample generates CS0698:

// CS0698.cs
class C<T> : System.Attribute  // CS0698
{
}
Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
OverCome      Sioln   |   Edit   |   Show History
There is a way to overcome.

e.g.

interfaceITranslationAttribute<DB_COLUMN_TYPE, PROPERTY_TYPE>

{

DB_COLUMN_TYPE GetValue(I_DB_Factory Factory, PROPERTY_TYPE PropertyValue);

}

[global::System.AttributeUsage(AttributeTargets.Property, Inherited = false, AllowMultiple = false)]

public class TranslationClientIDAttribute:Attribute, Translation.ITranslationAttribute <string,long>

{

public string GetValue(I_DB_Factory Factory, long PropertyValue) {return ""; }

}

Tags What's this?: Add a tag
Flag as ContentBug
Processing
© 2009 Microsoft Corporation. All rights reserved. Terms of Use  |  Trademarks  |  Privacy Statement
Page view tracker