File tree Expand file tree Collapse file tree 5 files changed +75
-1
lines changed Expand file tree Collapse file tree 5 files changed +75
-1
lines changed Original file line number Diff line number Diff line change @@ -119,6 +119,10 @@ reported a the [GibHub repository](https://github.com/dotnet-project-file-analyz
119119* [ ** Proj0452** Test projects require Microsoft.NET.Test.Sdk] ( rules/Proj0452.md )
120120* [ ** Proj0453** Using Microsoft.NET.Test.Sdk implies a test project] ( rules/Proj0453.md )
121121
122+ ### Licensing
123+ * [ ** Proj0500** Only include packages with an explicitly defined license] ( rules/Proj0500.md )
124+ * [ ** Proj0501** Only include packages with a compliant license] ( rules/Proj0501.md )
125+
122126### .NET Project File Analyzers SDK
123127* [ ** Proj0700** Avoid defining < ; Compile> ; items in SDK project] ( rules/Proj0700.md )
124128
Original file line number Diff line number Diff line change 22title : General
33parent : MSBuild
44ancestor : Rules
5- nav_order : 9
5+ nav_order : 10
66---
Original file line number Diff line number Diff line change 1+ ---
2+ title : MSBuild
3+ parent : Rules
4+ nav_order : 4
5+ ---
Original file line number Diff line number Diff line change 1+ ---
2+ parent : Licening
3+ ancestor : Rules
4+ ---
5+
6+ # Proj0500: Only include packages with an explicitly defined license
7+ Using a [ NuGet] ( https://www.nuget.org ) (third-party) package implies that you
8+ and/or your company explicitly agree with the legally binding conditions of the
9+ license and the copyright of the onwer of the package.
10+
11+ As Microsoft states it itself:
12+ > If a package does not specify the licensing terms, contact the package owner
13+ > directly using the Contact owners link on the [ NuGet.org] ( https://www.nuget.org )
14+ > package page. Microsoft does not license any intellectual property to you
15+ > from third party package providers and is not responsible for information
16+ > provided by third parties.
17+
18+ When you use packages that are only (privatly) shared without your company
19+ those packages should also come with an explicitly defined license. You might
20+ need to contact your legal department to define a proper license.
21+
22+ ## See
23+ * [ NuGet.org frequently-asked questions] ( https://learn.microsoft.com/nuget/nuget-org/nuget-org-faq#license-terms )
24+ * [ How to Avoid Costly Lawsuits from Unexpected NuGet License Agreements] ( https://blog.inedo.com/nuget/how-to-avoid-costly-lawsuits-from-unexpected-nuget-license-agreements/ )
Original file line number Diff line number Diff line change 1+ ---
2+ parent : Licening
3+ ancestor : Rules
4+ ---
5+
6+ # Proj0501: Only include packages with a compliant license
7+ Using a [ NuGet] ( https://www.nuget.org ) (third-party) package implies that you
8+ and/or your company explicitly agree with the legally binding conditions of the
9+ license and the copyright of the onwer of the package.
10+
11+ By default, MIT and Apache-2.0 are allowed.
12+
13+ ## Configure
14+ You can specify which license (expressions) are allowed, using ` <AllowedLicenses> ` .
15+
16+ ``` xml
17+ <Project Sdk =" Microsoft.NET.Sdk" >
18+
19+ <PropertyGroup >
20+ <AllowedLicenses >MIT,MPL-1.1,Apache-2.0</AllowedLicenses >
21+ </PropertyGroup >
22+
23+ </Project >
24+ ```
25+
26+ For packages that do not come with a generic license (expression) such as MIT,
27+ it is possible to specify that these packages are allowed, using the
28+ ` <AllowedThirdPartyPackages> ` . Wildcard characters are allowed.
29+
30+ ``` xml
31+ <Project Sdk =" Microsoft.NET.Sdk" >
32+
33+ <PropertyGroup >
34+ <AllowedThirdPartyPackages >
35+ SonarAnalyzer.Csharp,
36+ MyCompany.*
37+ /AllowedThirdPartyPackages>
38+ </PropertyGroup >
39+
40+ </Project >
41+ ```
You can’t perform that action at this time.
0 commit comments