Allvarligt fel C1191

"dll" kan endast importeras i globalt omfång

Anmärkningar

Instruktionen att importera mscorlib.dll till ett program som använder /clr-programmering kan inte visas i ett namnområde eller en funktion, men måste visas i globalt omfång.

Exempel

I följande exempel genereras C1191:

// C1191.cpp
// compile with: /clr
namespace sample {
   #using <mscorlib.dll>   // C1191 not at global scope
}

Möjlig lösning:

// C1191b.cpp
// compile with: /clr /c
#using <mscorlib.dll>
namespace sample {}