How to add .snk file to Project from Common folder

In the current application, I have nearly 200 projects and needs to be strong named all of them to ensure the best to the project.

I have used the below steps to ensure that the team needs to use only one .snk file across the application projects. In general, if you strong name the appliation in a single project, the copy of the .snk file will be created in each project.

With the below, you don’t need to have multiple copies and multiple public key tokens for the same version of the project.

Assumption: You already have the .snk file created

  1. Create a project in Visual Studio.
  2. Right click on the project name and select existing item.
  3. Image
  4. Add an existing .snk file to the project as a link.
  5. Image
  6. Refer the added .snk file from the signing tab.
  7. Image
  8. Build the project.
  9. You need to repeat the same steps for all the projects in your application.

You are good to go..!!

Hope this helps. Happy coding.. 🙂

~ Gangadhar Kotu

Advertisements

4 responses to this post.

  1. Hi,

    What if I donot want the path to be shown in the signing tab and just want to snk itself. Can I copy the snk from the common folder to the project folder?

    Thanks,
    Sr

    Reply

    • Only on the signing tab, it will show the full path but the path will be stored in the .csproj file as relative path. ../../../***.snk. If you can open the .csproj/.vbproj in a notepad, you can notice all the relative paths.

      If you copy that to the project folder, then it becomes a physical copy on each folder.

      Reply

  2. Thanks for your qucik response! I am relatively new to .NET. What if I donot want the path to be shown even the .csproj. Can i edit it? I just created a Test Project and for some reason i donot see the path even in .csproj after physically copying it. Also, is it a good method to delete the old snk we get when we create a new proj. Is it okay to copy the snk from other proj?

    Reply

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: