You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
`Directory.Build.props` is an MSBuild file which will be imported by all projects in your game.
32
-
It is like a file that contains global variables. In this case the version of MonoGame we want to use.
33
-
34
-
To find out the latest version number, you can look at one of the packages at [https://github.com/orgs/MonoGame/packages?repo_name=MonoGame](https://github.com/orgs/MonoGame/packages?repo_name=MonoGame). Or to get the information from the GitHub feed, you can run the following command.
The version number you want to use is listed in the output.
70
-
71
-
> [!NOTE]
72
-
> As packages are published, the version number will always change. Unfortunately, due to limitations in the way NuGet works, we cannot
73
-
> use a wildcard with a pre-release package (so you cannot do `1.0.0.*-develop`). So this is the best way to find the latest verion you want to use.
74
-
75
-
Next update all the `PackageReference` entries in your csproj's which use MonoGame to use `$(MonoGamePackageVersion)` MSBuild property.
1
+
---
2
+
title: Using the Development Nuget Packages
3
+
description: How to use the latest development NuGet packages to use the cutting edge of MonoGame development in your project.
4
+
---
5
+
6
+
## Overview
7
+
8
+
When the MonoGame develop branch builds, it publishes development NuGet packages to the MonoGame NuGet Feed on GitHub. If you want to test a new feature or just be on the very latest code you can use this Feed to do that.
9
+
10
+
## Adding a NuGet Source
11
+
12
+
1. Create a `NuGet.config` in the root or top level directory of your project.
13
+
14
+
> [!NOTE]
15
+
> NuGet will automatically walk up the directory tree to find `NuGet.config` files.
`Directory.Build.props` is an MSBuild file which will be imported by all projects in your game. It is like a file that contains global variables. In this case the version of MonoGame we want to use.
39
+
40
+
> [!NOTE]
41
+
> To find out the latest version number, you can look at one of the packages at [https://github.com/orgs/MonoGame/packages?repo_name=MonoGame](https://github.com/orgs/MonoGame/packages?repo_name=MonoGame). Or to get the information from the GitHub feed, you can run the following command.
The version number you want to use is listed in the output.
77
+
78
+
> [!NOTE]
79
+
> As packages are published, the version number will always change. Unfortunately, due to limitations in the way NuGet works, we cannot
80
+
> use a wildcard with a pre-release package (so you cannot do `1.0.0.*-develop`). So this is the best way to find the latest version you want to use.
81
+
82
+
1. Next update all the `PackageReference` entries in your `csproj`'s which use MonoGame to use `$(MonoGamePackageVersion)` MSBuild property.
76
83
For example:
77
84
78
85
```xml
@@ -82,24 +89,23 @@ For example:
82
89
</ItemGroup>
83
90
```
84
91
85
-
If you try to build now you will get an error. This is because the NuGet feeds on GitHub are not public. You need
86
-
to be a valid GitHub user to use them.
92
+
If you try to build now you will get an error. This is because the NuGet feeds on GitHub are not public. You need to be a valid GitHub user to use them.
87
93
88
94
## Authentication
89
95
90
-
You need to create a Personal Access Token (PAT) on your GitHub account in order to use the NuGet feed.
91
-
See the following documentation on how to create your PAT.
96
+
You need to create a **Personal Access Token** (PAT) on your GitHub account in order to use the NuGet feed. See the following documentation on how to create your PAT.
> You need to create a "PAT (Classic)" token in order for it to work with the Nuget feed. See [creating-a-personal-access-token-classic](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens#creating-a-personal-access-token-classic) for details.
96
102
97
-
Once you have your PAT, you can create a new `NuGet.config` file in the directory ABOVE your game project directory.
103
+
Once you have your **PAT**, you can create a new `NuGet.config` file in the directory ABOVE your game project directory.
98
104
To be clear, this file should NOT be in your source tree. It should be outside of any directory which is under source control.
99
105
100
-
```
106
+
```cli
101
107
Projects
102
-
NuGet.confing <-- THIS IS WHERE YOU PUT THE FILE.
108
+
NuGet.config <-- THIS IS WHERE YOU PUT THE FILE.
103
109
MyGame
104
110
.git
105
111
Directory.Build.props
@@ -110,11 +116,11 @@ To be clear, this file should NOT be in your source tree. It should be outside o
110
116
```
111
117
112
118
> [!IMPORTANT]
113
-
> Do Not... DO NOT place a NuGet.config file with valid `packageSourceCredentials` in your source control.
119
+
> Do Not... **DO NOT** place a `NuGet.config` file with valid `packageSourceCredentials` in your source control.
114
120
115
121
The contents of the file are as follows, replace `%GITHUB_USER%` with your GitHub username and the `%GITHUB_TOKEN%` with your token.
116
122
117
-
```
123
+
```xml
118
124
<?xml version="1.0" encoding="utf-8"?>
119
125
<configuration>
120
126
<packageSourceCredentials>
@@ -126,6 +132,7 @@ The contents of the file are as follows, replace `%GITHUB_USER%` with your GitHu
126
132
</configuration>
127
133
```
128
134
129
-
The really good thing about placing these credentials outside of source control is that they are safe. But also any
130
-
new projects you create under that folder can also make use of these createntials. So it is a good idea to keep them in one place.
131
-
For more information, you can read [consuming-packages-authenticated-feeds](https://learn.microsoft.com/en-us/nuget/consume-packages/consuming-packages-authenticated-feeds#credentials-in-nugetconfig-files).
135
+
The really good thing about placing these credentials outside of source control is that they are safe. But also any new projects you create under that folder can also make use of these credentials. So it is a good idea to keep them in one place.
136
+
137
+
> [!NOTE]
138
+
> For more information, you can read [consuming-packages-authenticated-feeds](https://learn.microsoft.com/en-us/nuget/consume-packages/consuming-packages-authenticated-feeds#credentials-in-nugetconfig-files).
0 commit comments