共用方式為


編譯器警告 (層級 1) CS1616

更新:2007 年 11 月

錯誤訊息

選項 'option' 會覆寫原始程式檔或加入的模組中指定的屬性 'attribute'

如果在原始程式碼中的組件屬性 AssemblyKeyFileAssemblyKeyName,與 /keyfile/keycontainer 命令列選項或者 [專案屬性] 中指定的金鑰檔名稱或金鑰容器發生衝突,便會發生這個警告。

以下範列中,假設您有一個名為 cs1616.snk 的金鑰檔。這個檔案可用命令列產生:

sn –k CS1616.snk

下列範例會產生 CS1616:

// CS1616.cs
// compile with: /keyfile:cs1616.snk
using System.Reflection;

// To fix the error, remove the next line
[assembly: AssemblyKeyFile("cs1616b.snk")]  // CS1616

class C
{
  public static void Main()
  {
  }
}