diff --git a/src/Microsoft.DotNet.Tools.Compiler.Csc/Program.cs b/src/Microsoft.DotNet.Tools.Compiler.Csc/Program.cs index 82c9050a7..9db6e2550 100644 --- a/src/Microsoft.DotNet.Tools.Compiler.Csc/Program.cs +++ b/src/Microsoft.DotNet.Tools.Compiler.Csc/Program.cs @@ -142,6 +142,15 @@ namespace Microsoft.DotNet.Tools.Compiler.Csc if (options.KeyFile != null) { commonArgs.Add($"-keyfile:\"{options.KeyFile}\""); + + // If we're not on Windows, full signing isn't supported, so we'll + // public sign, unless the public sign switch has explicitly been + // set to false + if (!RuntimeInformation.IsOSPlatform(OSPlatform.Windows) && + options.PublicSign == null) + { + commonArgs.Add("-publicsign"); + } } if (options.DelaySign == true)