Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

proper way to sign .net core assembly

I'm trying to sign a .net core lib, and I'm just not sure if I did everything correctly

1) using VS Command Promp I called sn -k mykey.snk

2) copied mykey.snk to myproject folder

3) in project.json added keyfile

"frameworks": {
    "netstandard1.6": {}
  },
  "buildOptions": {
    "outputName": "MyLib",
    "keyFile": "mykey.snk"
  }

is this correct, is the library (dll) going to be usable on both .net core and full .net 4.6 apps ?

like image 588
Omu Avatar asked Jul 18 '16 11:07

Omu


1 Answers

Yes, this is the correct way. If you look into any ASP.NET Core projects, like Logging, you will find

"buildOptions": {
   "keyFile": "../../tools/Key.snk"
   ...
}

in project.json file, and Key.snk in Tools folder. You also may check .NET Core - strong name assemblies issue.

like image 118
Set Avatar answered Oct 28 '22 09:10

Set