Compiler Error C3462
Visual Studio 2015
The new home for Visual Studio documentation is Visual Studio 2017 Documentation on docs.microsoft.com.
The latest version of this topic can be found at Compiler Error C3462.
type': only an imported type can be forwarded
The TypeForwardedTo attribute must be applied to a type in referenced metadata.
For more information, see Type Forwarding (C++/CLI).
The following sample creates a component.
// C3462.cpp
// compile with: /clr /LD
public ref class R {};
The following sample generates C3462.
// C3462b.cpp
// compile with: /clr /c
#using "C3462.dll"
ref class N {};
[assembly:TypeForwardedTo(N::typeid)]; // C3462
[assembly:TypeForwardedTo(R::typeid)];
Show: