Export (0) Print
Expand All
Expand Minimize

Compiler Error C3386

Error Message

'type' : __declspec(dllexport)/__declspec(dllimport) cannot be applied to a managed type

The dllimport and dllexport __declspec modifiers are not valid on a managed type.

The following sample generates C3386:

// C3386a.cpp
// compile with: /clr /c
ref class __declspec(dllimport) X1 {   // C3386
// try the following line instead
// ref class X1 {
};

The following sample generates C3386:

// C3386b.cpp
// compile with: /clr:oldSyntax /c
#using <mscorlib.dll>
using namespace System;

__gc class __declspec(dllimport) X1 {   // C3386
// try the following line instead
// __gc class X1 {
};

Community Additions

ADD
Show:
© 2014 Microsoft