diff options
author | Kirill Osenkov <KirillOsenkov@users.noreply.github.com> | 2016-11-17 10:26:59 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-11-17 10:26:59 +0300 |
commit | 093756ab6dbce237f8e396a7099de93f76e4fbf9 (patch) | |
tree | e0f48998919d6d72c9cd7c8d89e3806f0b8ed7af /Documentation/project-docs | |
parent | 0631d8c674fa3d6114ddeb25c2af7952c9e9535d (diff) |
Add information about /publicsign compiler flag
Add some information about reading and setting the public-sign flag on binaries using corflags and FakeSign.exe tools. Additionally mention the /publicsign compiler option and MSBuild property.
Diffstat (limited to 'Documentation/project-docs')
-rw-r--r-- | Documentation/project-docs/public-signing.md | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/Documentation/project-docs/public-signing.md b/Documentation/project-docs/public-signing.md index 9f18357dd3..45cda1bff7 100644 --- a/Documentation/project-docs/public-signing.md +++ b/Documentation/project-docs/public-signing.md @@ -16,3 +16,21 @@ Known issues when debugging and testing public signed assemblies on .NET Framewo - You will not be able to install the assembly to the [Global Assembly Cache (GAC)](https://msdn.microsoft.com/en-us/library/yf1d93sz.aspx) - You will not be able to load the assembly in an AppDomain where shadow copying is turned on. - You will not be able to load the assembly in a partially trusted AppDomain + +The `corflags.exe` tool that ships with the .NET Framework SDK can show whether a binary is delay-signed or strong-named. For a delay-signed assembly it may show: + +``` +CorFlags : 0x20003 +``` + +For a strong-named assembly it can show: + +``` +CorFlags : 0x2000b +``` + +The bit that is flipped is 0x8. If the bit is set, the assembly is strong-named. Additionally, the `sn.exe -vf` tool can show the same information. It will output `<assembly> is a delay-signed or test-signed assembly` or `Failed to verify assembly -- Strong name validation failed.` for a public-signed binary. + +The [FakeSign package on NuGet](https://www.nuget.org/packages/fakesign) contains the `FakeSign.exe` tool that can flip the bit on or off. + +Additionally, starting with Visual Studio 2015 Update 2 the C# and VB compilers support the new `/publicsign` command-line argument. You can also pass it to the compiler from your MSBuild project by setting the `<PublicSign>True</PublicSign>` MSBuild property to true. Note that you have to set `<DelaySign>False</DelaySign>` otherwise you will get an error that DelaySign and PublicSign can't be both specified at the same time. |