Compiler Warning (level 1) CS1616

选项“option”重写源文件或附加模块中给出的特性“attribute”

如果源文件中的程序集特性 AssemblyKeyFileAttributeAssemblyKeyNameAttribute 与项目属性中指定的 /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()
  {
  }
}