Question

I'm going to be deploying my MVC 4 web application to a hosting provider via VS Web Deploy.

I've never previously signed .net assemblies but from my research it seems there are 2 ways:

  1. Use AssemblyLinker (Al.exe)
  2. Use [assembly:AssemblyKeyFileAttribute("keyfile.snk")] or [assembly:AssemblyKeyNameAttribute("myContainer")]

Since I want to avoid RDP'ing to the host and signing the assemblies post deployment. I'll assume I should use option 2.

I used VS command prompt like this to generate the file: sn.exe -k mydomain.snk

Now should I just add [assembly:AssemblyKeyFileAttribute("mydomain.snk")] to AssemblyInfo.cs in each project in the solution and then deploy the application?

What default locations will it check for this file? I'd like to avoid adding it into each project and have 15 copies floating around.

Am I missing anything else?

Was it helpful?

Solution

I usually have it in some Common or Shared folder on the same level as the project folders and provide relative path to it. Default folder is the project's binaries folder (Debug/Release) as far as I remember.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top