编译器错误 CS2034Compiler Error CS2034

声明外部别名的 /reference 选项只能有一个文件名。A /reference option that declares an extern alias can only have one filename. 若要指定多个别名或文件名,请使用多个 /reference 选项。To specify multiple aliases or filenames, use multiple /reference options.

若要指定两个别名和/或文件名,使用两个 /reference 选项,如下所示:To specify two aliases and/or file names, use two /reference options, like this:

示例Example

下面的代码将生成错误 CS2034。The following code will generate error CS2034.

// CS2034.cs  
// compile with: /r:A1=cs2034a1.dll;A2=cs2034a2.dll  
// to fix, compile with: /r:A1=cs2034a1.dll /r:A2=cs2034a2.dll  
// CS2034  
extern alias A1;  
extern alias A2;  
using System;