Re: Adding an AssemblyKeyFileAttribute to a Visual Basic App
From: Joe Kaplan \(MVP - ADSI\) (joseph.e.kaplan_at_removethis.accenture.com)
Date: Thu, 21 Oct 2004 12:06:09 -0500
The path is relative to the obj\debug or obj\release directory (where the
actual compiled files are placed initially) the way VS.NET compiles the
project. Normally, people put the snk file in the root of the project file
and do 2 parent paths in the key file path:
Knowing that should give you some options. You can also use sn to store it
in a key container and user AssemblyKeyName instead.
"Patrick" <firstname.lastname@example.org> wrote in message
> To be brutally honest, I'm still new to VB and this is a little above me.
> After digging around on MS's site, I added the lines:
> Option Explicit On
> Imports System.Reflection
> <Assembly: AssemblyKeyFile("smsupdate.snk")>
> To the top of my code (seems to be correct (no blue lines ;)) - but no
> matter where I put smsupdate.snk - the program can't seem to find it when
> trying to build - that's my new issue.
> I feel comfortable with anything about this program, but I've spent more
> time trying to get the program to run from a share than actually putting
> together - this is a little too much at this point for me. I understand
> inherited permissions, rights, roles, most everything about AD, NT,
> whatever permissions, but now having to deal with inherent file
> is too much for my brain.
> However, no matter what I do, I know the first time is the worst/hardest,
> I need to figure this out, so thanks for your time!
> "Nicole Calinoiu" <calinoiu REMOVETHIS AT gmail DOT com> wrote in message
>> What are these instructions that you are following? Is there some
>> problem that you're having adding the AssemblyKeyFile and AssemblyVersion
>> "Patrick" <email@example.com> wrote in message
>> > Hello - after completing a simple app and finally getting it right, I
>> > the app on a network share for others to test. Well, you know the rest.
>> > Doesn't work with a System.Security.Permissions.SecurityPermission
>> > I
>> > found out about the .NET administrative tool to create an MSI and it
>> > if I apply that to a system before I run the app. The notes about
>> > using it this way have me spooked, though.
>> > I would like to add a strong name to my app, and have run and created a
>> > key
>> > using sn -k myappname.snk
>> > But the instructions say to add an AssemblyKeyFileAttribute to your
>> > assembly, and this points to the snk file. I also need the
>> > AssemblyVersionAttribute. This is driving me crazy - 3 days to develop
>> > solution, 5 days to get the app to work on our Network. I'm pretty new
>> > this, and this is probably the most deflating part...