Kompilatorfel C3451

"attribut": kan inte använda ohanterat attribut för "typ"

Anmärkningar

Det går inte att tillämpa ett C++-attribut på en CLR-typ. Mer information finns i Referens för C++-attribut .

Mer information finns iUser-Defined Attribut.

Det här felet kan genereras som ett resultat av kompilatorns efterlevnadsarbete som utfördes för Visual Studio 2005: attributet uuid tillåts inte längre för ett användardefinierat attribut med hjälp av CLR-programmering. Använd GuidAttribute i stället.

Example

I följande exempel genereras C3451.

// C3451.cpp
// compile with: /clr /c
using namespace System;
[ attribute(AttributeTargets::All) ]
public ref struct MyAttr {};

[ MyAttr, helpstring("test") ]   // C3451
// try the following line instead
// [ MyAttr ]
public ref struct ABC {};