From bf91b4fc1e2edc583247f42f56f723285ecde3dc Mon Sep 17 00:00:00 2001 From: OnZi12 Date: Fri, 15 Oct 2021 15:51:58 +0300 Subject: [PATCH 1/2] Add explanation on dependent projects (by Nuget or in the solution) --- README.md | 55 ++++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 54 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index db5fcb3..a3c79f6 100644 --- a/README.md +++ b/README.md @@ -73,7 +73,7 @@ File name: 'Octokit, Version=0.16.0.0, Culture=neutral, PublicKeyToken=null' at Program.MainAsync() at Program.d__1.MoveNext() in C:\Users\daplaist\Documents\Visual Studio 2015\Projects\ConsoleApplication13\ConsoleApplication13\Program.cs:line 19](images/StrongNameSadPanda.png) - :disappointed: -- Add a reference to the [StrongNamer](https://www.nuget.org/packages/strongnamer) +- Add a reference to the [StrongNamer] NuGet package - Start without debugging (CTRL+F5) @@ -92,3 +92,56 @@ to do this. # Options You can conditionally disable automated signing of unsigned packages by setting the "DisableStrongNamer" property to "true". This is particularly useful if you have a custom build configuration for your application (e.g., you only wish for unsigned packages to be autosigned in specific environments). + +``.csproj`` Example: +``` xml + +... +True + +``` + +# Frequently Asked Questions + +### [Q] I have many projects. Which projects should I add StrongNamer to? + +You should add [StrongNamer] to any project that meets both of the following conditions: +1. **Signed** project +2. **Directly** consume an unsigned package. + +#### Important + +You'll need to modify the StrongNamer reference so consumer projects (even Tests project) will run the [StrongNamer] magic when they run. +Example: +``` xml + + +``` + +By default, the ``PrivateAssets`` value includes ``build``, which cause the [StrongNamer] magic to not propogate to dependent projects. +More on PrivateAssets [here.](https://docs.microsoft.com/en-us/nuget/consume-packages/package-references-in-project-files#controlling-dependency-assets) + + +### [Q] I would like to release my project as a NuGet package, should I do something special? + +If you are manually editing you ``nuspec`` file, make sure to add [StrongNamer] dependency like this: +``` xml + +``` + + +If you are using ``dotnet pack`` to create your package (pipeline or CLI), you will need to change the ``PrivateAssets`` of the [StrongNamer] reference. +Please read the **Important** section of the previous question. + +This will eventually add a dependency to your .nuspec file like this: +``` xml + +``` + +``include="All"`` is equiliant to omiting it entirely (like in the manual ``nuspec`` method). + +**Now dependent projects will run your NuGet successfuly!** + + + +[StrongNamer]: https://www.nuget.org/packages/strongnamer \ No newline at end of file From b8da3cdc18ecc88b3770fd2582586355c1bf5d79 Mon Sep 17 00:00:00 2001 From: OnZi12 Date: Fri, 15 Oct 2021 16:08:48 +0300 Subject: [PATCH 2/2] grammer --- README.md | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index a3c79f6..da47daa 100644 --- a/README.md +++ b/README.md @@ -103,7 +103,7 @@ You can conditionally disable automated signing of unsigned packages by setting # Frequently Asked Questions -### [Q] I have many projects. Which projects should I add StrongNamer to? +### [Q] I have many projects. Which ones should I add StrongNamer to? You should add [StrongNamer] to any project that meets both of the following conditions: 1. **Signed** project @@ -111,7 +111,7 @@ You should add [StrongNamer] to any project that meets both of the following con #### Important -You'll need to modify the StrongNamer reference so consumer projects (even Tests project) will run the [StrongNamer] magic when they run. +You'll need to modify the StrongNamer reference so consumer projects (even Tests projects) will run the [StrongNamer] magic when they run. Example: ``` xml @@ -122,7 +122,7 @@ By default, the ``PrivateAssets`` value includes ``build``, which cause the [Str More on PrivateAssets [here.](https://docs.microsoft.com/en-us/nuget/consume-packages/package-references-in-project-files#controlling-dependency-assets) -### [Q] I would like to release my project as a NuGet package, should I do something special? +### [Q] I would like to release my project as a NuGet package. Should I do something special? If you are manually editing you ``nuspec`` file, make sure to add [StrongNamer] dependency like this: ``` xml @@ -130,17 +130,16 @@ If you are manually editing you ``nuspec`` file, make sure to add [StrongNamer] ``` -If you are using ``dotnet pack`` to create your package (pipeline or CLI), you will need to change the ``PrivateAssets`` of the [StrongNamer] reference. -Please read the **Important** section of the previous question. +If you are using ``dotnet pack`` or ``MSBuild -t:pack`` to create your package (pipeline or CLI), you will need to change the ``PrivateAssets`` of the [StrongNamer] reference - Please read the **Important** section of the previous question. This will eventually add a dependency to your .nuspec file like this: ``` xml ``` -``include="All"`` is equiliant to omiting it entirely (like in the manual ``nuspec`` method). +``include="All"`` is equivalent to omitting it entirely (like in the manual ``nuspec`` method). -**Now dependent projects will run your NuGet successfuly!** +**Now dependent projects will run your NuGet successfully!**