Mike,
Before .NET 2.0, the assembly was used to indicate the location of the
key file. However, the path to the key file was baked into the assembly,
and it was considered a security risk.
So, in .NET 2.0, the location of the key was passed to the compiler, and
it signed the key at compile time without the attribute.
This is why you are getting the error. As not_a_commie says, you have
to go to your project, right click and select "properties". In the window
that comes up, select the build tab, which will then have an area where you
can set the strong name key file which will sign your assembly.
--
- Nicholas Paldino [.NET/C# MVP]
-
(E-Mail Removed)
"Mike P" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
>I have a class library that I want to make into a strongly named
> assembly. I have used the command line to create the key and added the
> snk file to my class library, and have now tried to add the following
> to the AssemblyInfo.cs :
>
> [assembly: AssemblyKeyFileAttribute("Email.snk")]
>
> But I get the error :
>
> Warning 1 Use command line option '/keyfile' or appropriate project
> settings instead of 'AssemblyKeyFileAttribute' C:\Documents and
> Settings\michaelp\My Documents\Visual Studio
> 2005\EmailChecker\EmailChecker\EmailChecker\Properties\AssemblyInfo.cs 3
> 7 12 EmailChecker
>
> Can anybody tell me why I am getting this error?
>
>
> Thanks,
>
> Mike
>
>
>
> *** Sent via Developersdex http://www.developersdex.com ***