Error: type or namespace name 'AssemblyKeyFileAttribute' and 'AssemblyKeyFile' could not be found

Posted on Microsoft .NET Support Team See other posts from Microsoft .NET Support Team
Published on Mon, 28 Dec 2009 07:53:00 +0000 Indexed on 2010/03/16 15:31 UTC
Read the original article Hit count: 374

To associate an assembly with a strong key file to store it to GAC, we use should include following line after all the imports and before defing namespace.

For VB.NET:  <Assembly: AssemblyKeyFile("c:\path\mykey.snk")>
For C#:    [assembly: AssemblyKeyFile(@"c:\path\mykey.snk")]

but, you might encounter following two errors at the time of creating Assembly for GAC.

1. The type or namespace name 'AssemblyKeyFileAttribute' could not be found (are you missing a using directive or an assembly reference?)

2. The type or namespace name 'AssemblyKeyFile' could not be found (are you missing a using directive or an assembly reference?)

How to resolve these errors: Just include "System.Reflection" namespace. It resolve above two errors.

© Microsoft .NET Support Team or respective owner

Related posts about .NET Assembly

Related posts about .NET Tips and Tricks