'How to sign F# class library in visual studio
Ive been trying to sign a FSharp Class library in visual studio and i am not sure what went wrong. when i select create a new strong name key file, visual studio will force restart. the below gif is a demo of me trying to sign the package.
i tried to create a snk file with in command line but i need to create a snk file with password protected given the D365 plugin require so. Any advice are appreciated!
Thanks in advance.
Solution 1:[1]
In Visual Studio these kind of issues can be caused by a bad behaving extension or perhaps a corrupted project file. Disable suspected extensions and try again.
Another fix is creating an snk file using the Strong Name Utility snk.exe and adding it to the project by hand. Remember, the signing tab of your project is just a handy UI for the underlying fsproj file.
Steps:
- Open the developer command prompt.
- Type
snk.exe -k mykey.snk. - Open your
.fsprojfile and add the following lines:
<PropertyGroup>
<SignAssembly>true</SignAssembly>
<AssemblyOriginatorKeyFile>mykey.snk</AssemblyOriginatorKeyFile>
</PropertyGroup>
- Compile your project and you're done.
An alternative for step 3 is adding an assembly attribute to your project:
[<assembly:AssemblyKeyFileAttribute("mykey.snk")>]
See also How to: Create a public-private key pair - MS Docs.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Henk van Boeijen |

