共用方式為


編譯器警告 (層級 1) C4944

'symbol': 無法從 'assembly1' 匯入符號:因為在目前的範圍中已經有 'symbol'

符號已定義於原始程式碼檔中,而 #using 陳述式已參考同時定義符號的組件。 會忽略組件中的符號。

範例

下列範例會建立具有 ClassA 類型的元件。

// C4944.cs
// compile with: /target:library
// C# source code to create a dll
public class ClassA {
   public int i;
}

下列範例會產生 C4944。

// C4944b.cpp
// compile with: /clr /W1
class ClassA {
public:
   int u;
};

#using "C4944.dll"   // C4944 ClassA also defined C4944.dll

int main() {
   ClassA * x = new ClassA();
   x->u = 9;
   System::Console::WriteLine(x->u);
}