Skip to content

Commit 99f440d

Browse files
authored
Add a single nuget config call-out in the best practices doc (#3435)
1 parent 53dfc21 commit 99f440d

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

docs/concepts/Security-Best-Practices.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,27 @@ Being able to have information about your dependencies such as their license, tr
154154

155155
For more information about Dependabot alerts & security updates, [see the following documentation](https://docs.github.com/en/github/managing-security-vulnerabilities/about-alerts-for-vulnerable-dependencies).
156156

157+
## NuGet Configuration
158+
159+
**📦 Package Consumer**
160+
161+
Add a `nuget.config` file in the root of your project repository. This is considered a best practice as it promotes repeatability and ensures that different users have the same NuGet configuration.
162+
We recommend adding `clear` elements to ensure no user or machine specific configuration is applied. [Read more about how settings are applied](../consume-packages/configuring-nuget-behavior.md#how-settings-are-applied).
163+
164+
For example:
165+
166+
```xml
167+
<configuration>
168+
<packageSources>
169+
<clear />
170+
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" />
171+
</packageSources>
172+
<packageSourceMapping>
173+
<clear />
174+
</packageSourceMapping>
175+
</configuration>
176+
```
177+
157178
### NuGet feeds
158179

159180
**📦 Package Consumer**

0 commit comments

Comments
 (0)