From 612d383f4430ceef9e3ce650639785bc43e86419 Mon Sep 17 00:00:00 2001 From: Werner van Deventer Date: Wed, 8 Dec 2021 13:35:23 +0200 Subject: [PATCH] Migrate automated task to .NET Standard 2.0 with corresponding dependencies to work in .NET Core only environments. Fixes issue #52. --- README.md | 10 +- ...Brutal.Dev.StrongNameSigner.Console.csproj | 20 +-- .../Properties/AssemblyInfo.cs | 4 +- .../app.config | 3 + .../packages.config | 4 +- .../StrongNameSigner.iss | 16 +-- .../StrongNameSigner.nuspec | 20 +-- ...StrongNameSigner.TestAssembly.Core5.csproj | 5 + .../C5.cs | 10 ++ .../Brutal.Dev.StrongNameSigner.Tests.csproj | 37 ++++-- .../SignAssemblyTests.cs | 12 ++ ...ongNameSigner.TestAssembly.Core5.deps.json | 23 ++++ ...ev.StrongNameSigner.TestAssembly.Core5.dll | Bin 0 -> 4608 bytes ...ev.StrongNameSigner.TestAssembly.Core5.pdb | Bin 0 -> 9656 bytes .../packages.config | 7 +- .../Brutal.Dev.StrongNameSigner.UI.csproj | 17 ++- .../Properties/AssemblyInfo.cs | 4 +- .../Properties/Resources.Designer.cs | 4 +- .../Properties/Settings.Designer.cs | 34 +++--- src/Brutal.Dev.StrongNameSigner.UI/app.config | 3 + .../packages.config | 6 +- src/Brutal.Dev.StrongNameSigner.sln | 12 +- .../AutomaticBuildTask.cs | 11 +- .../Brutal.Dev.StrongNameSigner.csproj | 114 +++--------------- .../ForceAssemblyReferenceAttribute.cs | 11 +- .../Properties/AssemblyInfo.cs | 46 ------- .../SigningHelper.cs | 4 +- .../StrongNameType.cs | 2 +- 28 files changed, 206 insertions(+), 233 deletions(-) create mode 100644 src/Brutal.Dev.StrongNameSigner.Console/app.config create mode 100644 src/Brutal.Dev.StrongNameSigner.TestAssembly.Core5/Brutal.Dev.StrongNameSigner.TestAssembly.Core5.csproj create mode 100644 src/Brutal.Dev.StrongNameSigner.TestAssembly.Core5/C5.cs create mode 100644 src/Brutal.Dev.StrongNameSigner.Tests/TestAssemblies/Brutal.Dev.StrongNameSigner.TestAssembly.Core5.deps.json create mode 100644 src/Brutal.Dev.StrongNameSigner.Tests/TestAssemblies/Brutal.Dev.StrongNameSigner.TestAssembly.Core5.dll create mode 100644 src/Brutal.Dev.StrongNameSigner.Tests/TestAssemblies/Brutal.Dev.StrongNameSigner.TestAssembly.Core5.pdb create mode 100644 src/Brutal.Dev.StrongNameSigner.UI/app.config delete mode 100644 src/Brutal.Dev.StrongNameSigner/Properties/AssemblyInfo.cs diff --git a/README.md b/README.md index 9c2bf1e..dee6ecb 100644 --- a/README.md +++ b/README.md @@ -37,7 +37,7 @@ If you are making use of the [NuGet package](https://www.nuget.org/packages/Brut ```xml + Command=""..\packages\Brutal.Dev.StrongNameSigner.3.0.0\build\StrongNameSigner.Console.exe" -in "..\packages"" /> ``` @@ -57,7 +57,7 @@ To add multiple directories to process at the same time (similar to how the UI c ```xml + Command=""..\packages\Brutal.Dev.StrongNameSigner.3.0.0\build\StrongNameSigner.Console.exe" -in "..\packages\elmah.corelibrary.1.2.2|..\packages\Elmah.MVC.3.0.0"" /> ``` @@ -69,7 +69,7 @@ You can also use wildcards for each of your input directories. The above example ```xml + Command=""..\packages\Brutal.Dev.StrongNameSigner.3.0.0\build\StrongNameSigner.Console.exe" -in "..\packages\elmah.*"" /> ``` @@ -78,7 +78,7 @@ Wildcards can also be complex and placed anywhere in the path. This is useful if ```xml + Command=""..\packages\Brutal.Dev.StrongNameSigner.3.0.0\build\StrongNameSigner.Console.exe" -in "..\packages\Microsoft.*.Security*\*\net45"" /> ``` @@ -104,7 +104,7 @@ For example, ServiceStack's PostgreSQL NuGet package is not signed but other dep ```xml + Command=""..\packages\Brutal.Dev.StrongNameSigner.3.0.0\build\StrongNameSigner.Console.exe" -in "..\packages\ServiceStack.OrmLite.PostgreSQL.4.0.40\lib\net40|..\packages\ServiceStack.Text.Signed.4.0.40\lib\net40|..\packages\ServiceStack.OrmLite.Signed.4.0.40"" /> ``` diff --git a/src/Brutal.Dev.StrongNameSigner.Console/Brutal.Dev.StrongNameSigner.Console.csproj b/src/Brutal.Dev.StrongNameSigner.Console/Brutal.Dev.StrongNameSigner.Console.csproj index 82d095f..bbe22fa 100644 --- a/src/Brutal.Dev.StrongNameSigner.Console/Brutal.Dev.StrongNameSigner.Console.csproj +++ b/src/Brutal.Dev.StrongNameSigner.Console/Brutal.Dev.StrongNameSigner.Console.csproj @@ -1,5 +1,5 @@  - + Debug @@ -9,12 +9,13 @@ Properties Brutal.Dev.StrongNameSigner.Console StrongNameSigner.Console - v4.0 + v4.7.2 512 ..\ true + AnyCPU @@ -25,6 +26,7 @@ DEBUG;TRACE prompt 4 + false AnyCPU @@ -34,6 +36,7 @@ TRACE prompt 4 + false Icon.ico @@ -44,9 +47,10 @@ ..\..\keys\StrongNameSigner.snk + + true + - - ..\..\packages\PowerArgs.2.6.0.1\lib\net40\PowerArgs.dll @@ -54,7 +58,6 @@ - @@ -67,15 +70,16 @@ + + + + {947eecc6-5ebc-4d2a-bac4-8e88b5bafe84} Brutal.Dev.StrongNameSigner - - - diff --git a/src/Brutal.Dev.StrongNameSigner.Console/Properties/AssemblyInfo.cs b/src/Brutal.Dev.StrongNameSigner.Console/Properties/AssemblyInfo.cs index 9119f34..19f7c9e 100644 --- a/src/Brutal.Dev.StrongNameSigner.Console/Properties/AssemblyInfo.cs +++ b/src/Brutal.Dev.StrongNameSigner.Console/Properties/AssemblyInfo.cs @@ -33,5 +33,5 @@ // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("2.9.1.0")] -[assembly: AssemblyFileVersion("2.9.1.0")] +[assembly: AssemblyVersion("3.0.0.0")] +[assembly: AssemblyFileVersion("3.0.0.0")] diff --git a/src/Brutal.Dev.StrongNameSigner.Console/app.config b/src/Brutal.Dev.StrongNameSigner.Console/app.config new file mode 100644 index 0000000..312bb3f --- /dev/null +++ b/src/Brutal.Dev.StrongNameSigner.Console/app.config @@ -0,0 +1,3 @@ + + + diff --git a/src/Brutal.Dev.StrongNameSigner.Console/packages.config b/src/Brutal.Dev.StrongNameSigner.Console/packages.config index f774963..53f10c2 100644 --- a/src/Brutal.Dev.StrongNameSigner.Console/packages.config +++ b/src/Brutal.Dev.StrongNameSigner.Console/packages.config @@ -1,5 +1,5 @@  - - + + \ No newline at end of file diff --git a/src/Brutal.Dev.StrongNameSigner.Setup/StrongNameSigner.iss b/src/Brutal.Dev.StrongNameSigner.Setup/StrongNameSigner.iss index eef850d..2dc7611 100644 --- a/src/Brutal.Dev.StrongNameSigner.Setup/StrongNameSigner.iss +++ b/src/Brutal.Dev.StrongNameSigner.Setup/StrongNameSigner.iss @@ -4,7 +4,7 @@ #define MyAppID "{A89C23E7-A764-4F59-8EF3-5AB0A33E5849}" #define MyAppName ".NET Assembly Strong-Name Signer" #define MyAppNameNoSpaces "StrongNameSigner" -#define MyAppVersion "2.9.1.0" +#define MyAppVersion "3.0.0.0" #define MyAppPublisher "BrutalDev" #define MyAppURL "https://github.com/brutaldev/StrongNameSigner" #define MyAppExeName "StrongNameSigner.exe" @@ -48,17 +48,19 @@ win_sp_title=Windows %1 Service Pack %2 [Files] Source: "..\Brutal.Dev.StrongNameSigner.Docs\output\Help.chm"; DestDir: "{app}"; Flags: ignoreversion replacesameversion -Source: "..\Brutal.Dev.StrongNameSigner\bin\Release\Mono.Cecil.dll"; DestDir: "{app}"; Flags: ignoreversion replacesameversion -Source: "..\Brutal.Dev.StrongNameSigner\bin\Release\Mono.Cecil.Mdb.dll"; DestDir: "{app}"; Flags: ignoreversion replacesameversion -Source: "..\Brutal.Dev.StrongNameSigner\bin\Release\Mono.Cecil.Pdb.dll"; DestDir: "{app}"; Flags: ignoreversion replacesameversion -Source: "..\Brutal.Dev.StrongNameSigner\bin\Release\Mono.Cecil.Rocks.dll"; DestDir: "{app}"; Flags: ignoreversion replacesameversion -Source: "..\Brutal.Dev.StrongNameSigner\bin\Release\Brutal.Dev.StrongNameSigner.XML"; DestDir: "{app}"; Flags: ignoreversion replacesameversion -Source: "..\Brutal.Dev.StrongNameSigner\bin\Release\Brutal.Dev.StrongNameSigner.dll"; DestDir: "{app}"; Flags: ignoreversion replacesameversion +Source: "..\Brutal.Dev.StrongNameSigner\bin\Release\netstandard2.0\publish\Mono.Cecil.dll"; DestDir: "{app}"; Flags: ignoreversion replacesameversion +Source: "..\Brutal.Dev.StrongNameSigner\bin\Release\netstandard2.0\publish\Mono.Cecil.Mdb.dll"; DestDir: "{app}"; Flags: ignoreversion replacesameversion +Source: "..\Brutal.Dev.StrongNameSigner\bin\Release\netstandard2.0\publish\Mono.Cecil.Pdb.dll"; DestDir: "{app}"; Flags: ignoreversion replacesameversion +Source: "..\Brutal.Dev.StrongNameSigner\bin\Release\netstandard2.0\publish\Mono.Cecil.Rocks.dll"; DestDir: "{app}"; Flags: ignoreversion replacesameversion +Source: "..\Brutal.Dev.StrongNameSigner\bin\Release\netstandard2.0\publish\Brutal.Dev.StrongNameSigner.XML"; DestDir: "{app}"; Flags: ignoreversion replacesameversion +Source: "..\Brutal.Dev.StrongNameSigner\bin\Release\netstandard2.0\publish\Brutal.Dev.StrongNameSigner.dll"; DestDir: "{app}"; Flags: ignoreversion replacesameversion Source: "..\Brutal.Dev.StrongNameSigner.Console\bin\Release\StrongNameSigner.Console.exe"; DestDir: "{app}"; Flags: ignoreversion replacesameversion; Components: Console +Source: "..\Brutal.Dev.StrongNameSigner.Console\bin\Release\StrongNameSigner.Console.exe.config"; DestDir: "{app}"; Flags: ignoreversion replacesameversion; Components: Console Source: "..\Brutal.Dev.StrongNameSigner.Console\bin\Release\PowerArgs.dll"; DestDir: "{app}"; Flags: ignoreversion replacesameversion; Components: Console Source: "..\Brutal.Dev.StrongNameSigner.UI\bin\Release\Microsoft.WindowsAPICodePack.dll"; DestDir: "{app}"; Flags: ignoreversion replacesameversion; Components: UserInterface Source: "..\Brutal.Dev.StrongNameSigner.UI\bin\Release\Microsoft.WindowsAPICodePack.Shell.dll"; DestDir: "{app}"; Flags: ignoreversion replacesameversion; Components: UserInterface Source: "..\Brutal.Dev.StrongNameSigner.UI\bin\Release\StrongNameSigner.exe"; DestDir: "{app}"; Flags: ignoreversion replacesameversion; Components: UserInterface +Source: "..\Brutal.Dev.StrongNameSigner.UI\bin\Release\StrongNameSigner.exe.config"; DestDir: "{app}"; Flags: ignoreversion replacesameversion; Components: UserInterface [Icons] Name: "{group}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Components: UserInterface diff --git a/src/Brutal.Dev.StrongNameSigner.Setup/StrongNameSigner.nuspec b/src/Brutal.Dev.StrongNameSigner.Setup/StrongNameSigner.nuspec index 7a7c29a..01b061d 100644 --- a/src/Brutal.Dev.StrongNameSigner.Setup/StrongNameSigner.nuspec +++ b/src/Brutal.Dev.StrongNameSigner.Setup/StrongNameSigner.nuspec @@ -2,7 +2,7 @@ Brutal.Dev.StrongNameSigner - 2.9.1 + 3.0.0-beta .NET Assembly Strong-Name Signer Werner van Deventer Werner van Deventer @@ -20,22 +20,22 @@ If you strong-name sign your own projects you may have noticed that if you refer The tool will also re-write the assembly references (as well as any InternalsVisibleTo references) to match the new signed versions of the assemblies you create. Automatic strong-name signing of referenced assemblies. Utility software to strong-name sign .NET assemblies, including assemblies you do not have the source code for. - - Update to the latest Mono Cecil which fixes a number of issues that can only make things better. -- Fix issues #66. -- Remove validation for missing key file (will generate one). + +- Fix issue #52. Werner van Deventer (https://brutaldev.com) en-US strongname assembly gac unsigned strong name automatic - - - - - - + + + + + + + diff --git a/src/Brutal.Dev.StrongNameSigner.TestAssembly.Core5/Brutal.Dev.StrongNameSigner.TestAssembly.Core5.csproj b/src/Brutal.Dev.StrongNameSigner.TestAssembly.Core5/Brutal.Dev.StrongNameSigner.TestAssembly.Core5.csproj new file mode 100644 index 0000000..89631f5 --- /dev/null +++ b/src/Brutal.Dev.StrongNameSigner.TestAssembly.Core5/Brutal.Dev.StrongNameSigner.TestAssembly.Core5.csproj @@ -0,0 +1,5 @@ + + + net5.0 + + \ No newline at end of file diff --git a/src/Brutal.Dev.StrongNameSigner.TestAssembly.Core5/C5.cs b/src/Brutal.Dev.StrongNameSigner.TestAssembly.Core5/C5.cs new file mode 100644 index 0000000..afaadb2 --- /dev/null +++ b/src/Brutal.Dev.StrongNameSigner.TestAssembly.Core5/C5.cs @@ -0,0 +1,10 @@ +namespace Brutal.Dev.StrongNameSigner.TestAssembly.Core5 +{ + public class C5 + { + public C5() + { + + } + } +} diff --git a/src/Brutal.Dev.StrongNameSigner.Tests/Brutal.Dev.StrongNameSigner.Tests.csproj b/src/Brutal.Dev.StrongNameSigner.Tests/Brutal.Dev.StrongNameSigner.Tests.csproj index 6c3c4c8..33544a3 100644 --- a/src/Brutal.Dev.StrongNameSigner.Tests/Brutal.Dev.StrongNameSigner.Tests.csproj +++ b/src/Brutal.Dev.StrongNameSigner.Tests/Brutal.Dev.StrongNameSigner.Tests.csproj @@ -1,5 +1,5 @@  - + @@ -10,7 +10,7 @@ Properties Brutal.Dev.StrongNameSigner.Tests Brutal.Dev.StrongNameSigner.Tests - v4.0 + v4.7.2 512 {3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} 10.0 @@ -22,6 +22,7 @@ true + true @@ -31,6 +32,7 @@ DEBUG;TRACE prompt 4 + false pdbonly @@ -39,6 +41,7 @@ TRACE prompt 4 + false true @@ -47,15 +50,24 @@ ..\..\keys\StrongNameSigner.snk - - + + ..\..\packages\Mono.Cecil.0.11.4\lib\net40\Mono.Cecil.dll + + + ..\..\packages\Mono.Cecil.0.11.4\lib\net40\Mono.Cecil.Mdb.dll + + + ..\..\packages\Mono.Cecil.0.11.4\lib\net40\Mono.Cecil.Pdb.dll + + + ..\..\packages\Mono.Cecil.0.11.4\lib\net40\Mono.Cecil.Rocks.dll + - ..\..\packages\NUnit.3.13.2\lib\net40\nunit.framework.dll - True + ..\..\packages\NUnit.3.13.2\lib\net45\nunit.framework.dll - ..\..\packages\Shouldly.3.0.2\lib\net40\Shouldly.dll + ..\..\packages\Shouldly.3.0.2\lib\net451\Shouldly.dll @@ -78,6 +90,9 @@ + + PreserveNewest + Always @@ -174,6 +189,14 @@ Brutal.Dev.StrongNameSigner + + + PreserveNewest + + + PreserveNewest + + diff --git a/src/Brutal.Dev.StrongNameSigner.Tests/SignAssemblyTests.cs b/src/Brutal.Dev.StrongNameSigner.Tests/SignAssemblyTests.cs index b3eccff..0f23138 100644 --- a/src/Brutal.Dev.StrongNameSigner.Tests/SignAssemblyTests.cs +++ b/src/Brutal.Dev.StrongNameSigner.Tests/SignAssemblyTests.cs @@ -144,6 +144,18 @@ public void SignAssembly_Should_Reassemble_NET_40_x64_Assembly_Correctly() info.IsSigned.ShouldBe(true); } + [Test] + public void SignAssembly_Should_Reassemble_Core_5_Assembly_Correctly() + { + var info = SigningHelper.SignAssembly(Path.Combine(TestAssemblyDirectory, "Brutal.Dev.StrongNameSigner.TestAssembly.Core5.dll"), string.Empty, Path.Combine(TestAssemblyDirectory, "Signed")); + info.DotNetVersion.ShouldBe("4.0.30319"); + info.IsAnyCpu.ShouldBe(true); + info.Is32BitOnly.ShouldBe(false); + info.Is32BitPreferred.ShouldBe(false); + info.Is64BitOnly.ShouldBe(false); + info.IsSigned.ShouldBe(true); + } + [Test] public void SignAssembly_InPlaceWithPdb_Should_Succeed() { diff --git a/src/Brutal.Dev.StrongNameSigner.Tests/TestAssemblies/Brutal.Dev.StrongNameSigner.TestAssembly.Core5.deps.json b/src/Brutal.Dev.StrongNameSigner.Tests/TestAssemblies/Brutal.Dev.StrongNameSigner.TestAssembly.Core5.deps.json new file mode 100644 index 0000000..d351051 --- /dev/null +++ b/src/Brutal.Dev.StrongNameSigner.Tests/TestAssemblies/Brutal.Dev.StrongNameSigner.TestAssembly.Core5.deps.json @@ -0,0 +1,23 @@ +{ + "runtimeTarget": { + "name": ".NETCoreApp,Version=v5.0", + "signature": "" + }, + "compilationOptions": {}, + "targets": { + ".NETCoreApp,Version=v5.0": { + "Brutal.Dev.StrongNameSigner.TestAssembly.Core5/1.0.0": { + "runtime": { + "Brutal.Dev.StrongNameSigner.TestAssembly.Core5.dll": {} + } + } + } + }, + "libraries": { + "Brutal.Dev.StrongNameSigner.TestAssembly.Core5/1.0.0": { + "type": "project", + "serviceable": false, + "sha512": "" + } + } +} \ No newline at end of file diff --git a/src/Brutal.Dev.StrongNameSigner.Tests/TestAssemblies/Brutal.Dev.StrongNameSigner.TestAssembly.Core5.dll b/src/Brutal.Dev.StrongNameSigner.Tests/TestAssemblies/Brutal.Dev.StrongNameSigner.TestAssembly.Core5.dll new file mode 100644 index 0000000000000000000000000000000000000000..06d685fc3e6fb638e6ed799d340d2e30d91a68cb GIT binary patch literal 4608 zcmeHKU2IfE6h6~#ODR&Q`~+iy7t5bWE?broz$)ABwxvRU>@Fx~llJa*dbxP_-p##t zOB)ib37{|j#F${B4?g&4024Gw;)96^(TMT)%@9I-@JZu~F+PajnR|D)KWZ!q#0SoH z&dfP8bLKl|&dl5nJo_5e6HyH1)-9sTsF{+A|2vyOcgsUpTIkZ!Ya1?$L)SKBk6FG} z@?6t1idw;N95>MNQuE4=W;t4VD5DkKaj7p~-n=m~J={ZdNYvAwFHc^mtagJQ)|QDl zQ4=&=K<77uX(&k)qLr#$7vg3G<5x5T4n0#njh*44{8y_ZkyW6husg(!B+;8yBdmyM zjOacz>oSKvLL}Xz=)E zlv$Jndfk(@i-C-l#!%Rn@*8zTNuusbyHdZ*aRo89I%=StM)V!xAXs@Dw7G8UG6irO z7Rx-@Eh0;dYjT$!*AwwX`(8HOKsNXo7HT_1^abj5z}%JzJj*eC9`Pd*leeVpaE5+D zo84*aJKUc}{X66zSnjsnJZdIP7k#UVma_1NNYL8Q4_+I63JJie@UefPk0(V~H`1?k zLo`xKFh5Aw#0oX7ktWH2W}El`{2OBas^ae{-m3JYs=cD_yfT)6b+*sHl_)W4SM6bq z^=H>zg$)6mSFv_0cq2Uk-b{~xuf$m9dlm0eykGIB6hErC0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DxxX)B9fec39e(Q}EX?T7Dk- zb}N}4Q3j?trsnE+76wtO@}g6n;#bh%mbUnS;FXrH#~7U^nk_nbl!mY+6h0HwwB7xN zbB<}P+sgn2T=f!JgkaXV91bd-qe1>YuV zlOiIm!v?JmysAXr*QOQrHnOh4yZZ$%Gt3=HDZBPk-bIml;D-Qkz~S*JCgP8)4`hw< n?CS7oi|WsKB$WP39Q!fq+Ast`25D-7A1T4#E2;GZUy=U-;5!ar literal 0 HcmV?d00001 diff --git a/src/Brutal.Dev.StrongNameSigner.Tests/packages.config b/src/Brutal.Dev.StrongNameSigner.Tests/packages.config index 7921709..8e3cc75 100644 --- a/src/Brutal.Dev.StrongNameSigner.Tests/packages.config +++ b/src/Brutal.Dev.StrongNameSigner.Tests/packages.config @@ -1,6 +1,7 @@  - - - + + + + \ No newline at end of file diff --git a/src/Brutal.Dev.StrongNameSigner.UI/Brutal.Dev.StrongNameSigner.UI.csproj b/src/Brutal.Dev.StrongNameSigner.UI/Brutal.Dev.StrongNameSigner.UI.csproj index 4c77c8d..0357d0e 100644 --- a/src/Brutal.Dev.StrongNameSigner.UI/Brutal.Dev.StrongNameSigner.UI.csproj +++ b/src/Brutal.Dev.StrongNameSigner.UI/Brutal.Dev.StrongNameSigner.UI.csproj @@ -1,5 +1,5 @@  - + Debug @@ -9,7 +9,7 @@ Properties Brutal.Dev.StrongNameSigner.UI StrongNameSigner - v4.0 + v4.7.2 512 publish\ true @@ -30,6 +30,7 @@ true + AnyCPU @@ -40,6 +41,7 @@ DEBUG;TRACE prompt 4 + false AnyCPU @@ -49,6 +51,7 @@ TRACE prompt 4 + false true @@ -60,12 +63,10 @@ Icon.ico - - - + ..\..\packages\Windows7APICodePack-Core.1.1.0.0\lib\Microsoft.WindowsAPICodePack.dll - + ..\..\packages\Windows7APICodePack-Shell.1.1.0.0\lib\Microsoft.WindowsAPICodePack.Shell.dll @@ -112,6 +113,7 @@ Resources.resx True + SettingsSingleFileGenerator @@ -162,6 +164,9 @@ OnOutputUpdated + + true + diff --git a/src/Brutal.Dev.StrongNameSigner.UI/Properties/AssemblyInfo.cs b/src/Brutal.Dev.StrongNameSigner.UI/Properties/AssemblyInfo.cs index 66e6e60..791505e 100644 --- a/src/Brutal.Dev.StrongNameSigner.UI/Properties/AssemblyInfo.cs +++ b/src/Brutal.Dev.StrongNameSigner.UI/Properties/AssemblyInfo.cs @@ -33,5 +33,5 @@ // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("2.9.1.0")] -[assembly: AssemblyFileVersion("2.9.1.0")] +[assembly: AssemblyVersion("3.0.0.0")] +[assembly: AssemblyFileVersion("3.0.0.0")] diff --git a/src/Brutal.Dev.StrongNameSigner.UI/Properties/Resources.Designer.cs b/src/Brutal.Dev.StrongNameSigner.UI/Properties/Resources.Designer.cs index b764f48..b83447f 100644 --- a/src/Brutal.Dev.StrongNameSigner.UI/Properties/Resources.Designer.cs +++ b/src/Brutal.Dev.StrongNameSigner.UI/Properties/Resources.Designer.cs @@ -1,7 +1,7 @@ //------------------------------------------------------------------------------ // // This code was generated by a tool. -// Runtime Version:4.0.30319.33440 +// Runtime Version:4.0.30319.42000 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. @@ -19,7 +19,7 @@ namespace Brutal.Dev.StrongNameSigner.UI.Properties { // class via a tool like ResGen or Visual Studio. // To add or remove a member, edit your .ResX file then rerun ResGen // with the /str option, or rebuild your VS project. - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] internal class Resources { diff --git a/src/Brutal.Dev.StrongNameSigner.UI/Properties/Settings.Designer.cs b/src/Brutal.Dev.StrongNameSigner.UI/Properties/Settings.Designer.cs index 761f443..b993369 100644 --- a/src/Brutal.Dev.StrongNameSigner.UI/Properties/Settings.Designer.cs +++ b/src/Brutal.Dev.StrongNameSigner.UI/Properties/Settings.Designer.cs @@ -1,30 +1,26 @@ //------------------------------------------------------------------------------ // // This code was generated by a tool. -// Runtime Version:4.0.30319.33440 +// Runtime Version:4.0.30319.42000 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. // //------------------------------------------------------------------------------ -namespace Brutal.Dev.StrongNameSigner.UI.Properties -{ - - - [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")] - internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase - { - - private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); - - public static Settings Default - { - get - { - return defaultInstance; - } +namespace Brutal.Dev.StrongNameSigner.UI.Properties { + + + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "17.0.3.0")] + internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { + + private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); + + public static Settings Default { + get { + return defaultInstance; + } + } } - } } diff --git a/src/Brutal.Dev.StrongNameSigner.UI/app.config b/src/Brutal.Dev.StrongNameSigner.UI/app.config new file mode 100644 index 0000000..312bb3f --- /dev/null +++ b/src/Brutal.Dev.StrongNameSigner.UI/app.config @@ -0,0 +1,3 @@ + + + diff --git a/src/Brutal.Dev.StrongNameSigner.UI/packages.config b/src/Brutal.Dev.StrongNameSigner.UI/packages.config index 408faa1..485d922 100644 --- a/src/Brutal.Dev.StrongNameSigner.UI/packages.config +++ b/src/Brutal.Dev.StrongNameSigner.UI/packages.config @@ -1,6 +1,6 @@  - - - + + + \ No newline at end of file diff --git a/src/Brutal.Dev.StrongNameSigner.sln b/src/Brutal.Dev.StrongNameSigner.sln index a53364e..c2ee414 100644 --- a/src/Brutal.Dev.StrongNameSigner.sln +++ b/src/Brutal.Dev.StrongNameSigner.sln @@ -1,9 +1,9 @@  Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.26730.12 +# Visual Studio Version 17 +VisualStudioVersion = 17.0.31912.275 MinimumVisualStudioVersion = 10.0.40219.1 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Brutal.Dev.StrongNameSigner", "Brutal.Dev.StrongNameSigner\Brutal.Dev.StrongNameSigner.csproj", "{947EECC6-5EBC-4D2A-BAC4-8E88B5BAFE84}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Brutal.Dev.StrongNameSigner", "Brutal.Dev.StrongNameSigner\Brutal.Dev.StrongNameSigner.csproj", "{947EECC6-5EBC-4D2A-BAC4-8E88B5BAFE84}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Brutal.Dev.StrongNameSigner.Tests", "Brutal.Dev.StrongNameSigner.Tests\Brutal.Dev.StrongNameSigner.Tests.csproj", "{3EA13C51-9A22-4045-8993-12391408A300}" EndProject @@ -37,6 +37,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Brutal.Dev.StrongNameSigner\StrongNameSigner.targets = Brutal.Dev.StrongNameSigner\StrongNameSigner.targets EndProjectSection EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Brutal.Dev.StrongNameSigner.TestAssembly.Core5", "Brutal.Dev.StrongNameSigner.TestAssembly.Core5\Brutal.Dev.StrongNameSigner.TestAssembly.Core5.csproj", "{93BD3735-66AD-4741-8F10-9B5367171FE4}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -75,6 +77,10 @@ Global {1DACFD7E-47BA-4B8E-83AF-5580E3EFC744}.Debug|Any CPU.Build.0 = Debug|Any CPU {1DACFD7E-47BA-4B8E-83AF-5580E3EFC744}.Release|Any CPU.ActiveCfg = Release|Any CPU {1DACFD7E-47BA-4B8E-83AF-5580E3EFC744}.Release|Any CPU.Build.0 = Release|Any CPU + {93BD3735-66AD-4741-8F10-9B5367171FE4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {93BD3735-66AD-4741-8F10-9B5367171FE4}.Debug|Any CPU.Build.0 = Debug|Any CPU + {93BD3735-66AD-4741-8F10-9B5367171FE4}.Release|Any CPU.ActiveCfg = Release|Any CPU + {93BD3735-66AD-4741-8F10-9B5367171FE4}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/src/Brutal.Dev.StrongNameSigner/AutomaticBuildTask.cs b/src/Brutal.Dev.StrongNameSigner/AutomaticBuildTask.cs index ee4feb4..fddb43f 100644 --- a/src/Brutal.Dev.StrongNameSigner/AutomaticBuildTask.cs +++ b/src/Brutal.Dev.StrongNameSigner/AutomaticBuildTask.cs @@ -101,7 +101,7 @@ public override bool Execute() } } - if (signedAssembly != null && signedAssembly.IsSigned) + if (signedAssembly?.IsSigned == true) { signedAssemblyPaths.Add(signedAssembly.FilePath); processedAssemblyPaths.Add(signedAssembly.FilePath); @@ -145,11 +145,12 @@ public override bool Execute() NewCopyLocalFiles = new ITaskItem[CopyLocalPaths.Length]; for (int i = 0; i < CopyLocalPaths.Length; i++) { - string updatedPath; - if (updatedReferencePaths.TryGetValue(CopyLocalPaths[i].ItemSpec, out updatedPath)) + if (updatedReferencePaths.TryGetValue(CopyLocalPaths[i].ItemSpec, out string updatedPath)) { - NewCopyLocalFiles[i] = new TaskItem(CopyLocalPaths[i]); - NewCopyLocalFiles[i].ItemSpec = updatedPath; + NewCopyLocalFiles[i] = new TaskItem(CopyLocalPaths[i]) + { + ItemSpec = updatedPath + }; } else { diff --git a/src/Brutal.Dev.StrongNameSigner/Brutal.Dev.StrongNameSigner.csproj b/src/Brutal.Dev.StrongNameSigner/Brutal.Dev.StrongNameSigner.csproj index 20826ca..c837e69 100644 --- a/src/Brutal.Dev.StrongNameSigner/Brutal.Dev.StrongNameSigner.csproj +++ b/src/Brutal.Dev.StrongNameSigner/Brutal.Dev.StrongNameSigner.csproj @@ -1,104 +1,22 @@ - - - - - Debug - AnyCPU - {947EECC6-5EBC-4D2A-BAC4-8E88B5BAFE84} - Library - Properties - Brutal.Dev.StrongNameSigner - Brutal.Dev.StrongNameSigner - v4.0 - 512 - OnOutputUpdated - ..\ - true - - - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - AllRules.ruleset - - - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - false - AllRules.ruleset - bin\Release\Brutal.Dev.StrongNameSigner.XML - - - true - + + + netstandard2.0 + Brutal.Dev.StrongNameSigner + 3.0.0.0 + Simple API to sign .NET assemblies with a strong-name key and fix assembly references. + Copyright © 2013-2021 + https://brutaldev.com/post/net-assembly-strong-name-signer + https://github.com/brutaldev/StrongNameSigner/ + latest + True ..\..\keys\StrongNameSigner.snk + True + - - - - ..\..\packages\Mono.Cecil.0.11.4\lib\net40\Mono.Cecil.dll - - - ..\..\packages\Mono.Cecil.0.11.4\lib\net40\Mono.Cecil.Mdb.dll - - - ..\..\packages\Mono.Cecil.0.11.4\lib\net40\Mono.Cecil.Pdb.dll - - - ..\..\packages\Mono.Cecil.0.11.4\lib\net40\Mono.Cecil.Rocks.dll - - - - - - - - - - - - - - - - - - - - - - PreserveNewest - Designer - + + + - - - - - - - This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - - - \ No newline at end of file diff --git a/src/Brutal.Dev.StrongNameSigner/ForceAssemblyReferenceAttribute.cs b/src/Brutal.Dev.StrongNameSigner/ForceAssemblyReferenceAttribute.cs index 1b06613..ad50e8f 100644 --- a/src/Brutal.Dev.StrongNameSigner/ForceAssemblyReferenceAttribute.cs +++ b/src/Brutal.Dev.StrongNameSigner/ForceAssemblyReferenceAttribute.cs @@ -1,4 +1,13 @@ using System; +using Brutal.Dev.StrongNameSigner; + +// These assemblies are used by Cecil, and reading assemblies with symbols without these DLL's present +// will cause an error ("No Symbols Found"). So to ensure that these are actually referenced by +// StrongNameSigner and copied along to the output directory as well as the UnitTests when running +// them, we use this "hack". +[assembly: ForceAssemblyReference(typeof(Mono.Cecil.Pdb.NativePdbReader))] +[assembly: ForceAssemblyReference(typeof(Mono.Cecil.Mdb.MdbReader))] +[assembly: ForceAssemblyReference(typeof(Mono.Cecil.Rocks.TypeDefinitionRocks))] namespace Brutal.Dev.StrongNameSigner { @@ -11,7 +20,7 @@ internal sealed class ForceAssemblyReferenceAttribute : Attribute // https://stackoverflow.com/questions/15816769/dependent-dll-is-not-getting-copied-to-the-build-output-folder-in-visual-studio public ForceAssemblyReferenceAttribute(Type forcedType) { - Action noop = _ => { }; + void noop(Type _) { } noop(forcedType); } } diff --git a/src/Brutal.Dev.StrongNameSigner/Properties/AssemblyInfo.cs b/src/Brutal.Dev.StrongNameSigner/Properties/AssemblyInfo.cs deleted file mode 100644 index 2ea378d..0000000 --- a/src/Brutal.Dev.StrongNameSigner/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,46 +0,0 @@ -using System; -using System.Reflection; -using System.Runtime.InteropServices; -using Brutal.Dev.StrongNameSigner; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("Brutal.Dev.StrongNameSigner")] -[assembly: AssemblyDescription("Simple API to sign .NET assemblies with a strong-name key and fix assembly references.")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("https://brutaldev.com")] -[assembly: AssemblyProduct("Brutal.Dev.StrongNameSigner")] -[assembly: AssemblyCopyright("Copyright © 2013-2021")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] -[assembly: CLSCompliant(true)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("64d853c0-07b2-4891-8f9a-352c00669028")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("2.9.1.0")] -[assembly: AssemblyFileVersion("2.9.1.0")] - -// These assemblies are used by Cecil, and reading assemblies with symbols without these DLL's present -// will cause an error ("No Symbols Found"). So to ensure that these are actually referenced by -// StrongNameSigner and copied along to the output directory as well as the UnitTests when running -// them, we use this "hack". -[assembly: ForceAssemblyReference(typeof(Mono.Cecil.Pdb.NativePdbReader))] -[assembly: ForceAssemblyReference(typeof(Mono.Cecil.Mdb.MdbReader))] -[assembly: ForceAssemblyReference(typeof(Mono.Cecil.Rocks.TypeDefinitionRocks))] diff --git a/src/Brutal.Dev.StrongNameSigner/SigningHelper.cs b/src/Brutal.Dev.StrongNameSigner/SigningHelper.cs index b921837..75a74e9 100644 --- a/src/Brutal.Dev.StrongNameSigner/SigningHelper.cs +++ b/src/Brutal.Dev.StrongNameSigner/SigningHelper.cs @@ -29,9 +29,7 @@ public static class SigningHelper /// A strong-name key pair array. public static byte[] GenerateStrongNameKeyPair() { -#pragma warning disable S4426 // Cryptographic keys should not be too short using (var provider = new RSACryptoServiceProvider(1024, new CspParameters() { KeyNumber = 2 })) -#pragma warning restore S4426 // Cryptographic keys should not be too short { return provider.ExportCspBlob(!provider.PublicOnly); } @@ -294,7 +292,7 @@ public static bool FixAssemblyReference(string assemblyPath, string referenceAss // Found a matching reference, let's set the public key token. if (assemblyReference != null && BitConverter.ToString(assemblyReference.PublicKeyToken) != BitConverter.ToString(b.Name.PublicKeyToken)) { - assemblyReference.PublicKeyToken = b.Name.PublicKeyToken ?? new byte[0]; + assemblyReference.PublicKeyToken = b.Name.PublicKeyToken ?? Array.Empty(); assemblyReference.Version = b.Name.Version; if (!a.Name.IsRetargetable) diff --git a/src/Brutal.Dev.StrongNameSigner/StrongNameType.cs b/src/Brutal.Dev.StrongNameSigner/StrongNameType.cs index d12bab8..6e84f64 100644 --- a/src/Brutal.Dev.StrongNameSigner/StrongNameType.cs +++ b/src/Brutal.Dev.StrongNameSigner/StrongNameType.cs @@ -13,7 +13,7 @@ public enum StrongNameType /// /// The assembly contains a public key but is not actually signed. /// - /// + /// /// Additional documentation on delay-signing. /// DelaySigned,