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
docs: update README for DocFxForUnity.csproj setup and UNITY_MANAGED_PATH
- Add DocFxForUnity.csproj to the list of files to copy in setup step 2,
with a note on renaming and updating docfx.json
- Replace the outdated "Assets > Open C# Project" troubleshooting tip
with instructions matching the committed .csproj approach
- Add a "Unity managed DLLs not found" FAQ entry describing the
three-step resolution order (env var → lib/ → OS glob)
- Add a new "Advanced: UNITY_MANAGED_PATH" section with per-OS paths
and shell snippets for overriding the auto-detected Unity version
- Update xref version examples from 2017/2018/2019 to current versions
https://claude.ai/code/session_01DctbQWKKrBNCfvBuKsu5ad
2. Copy the `Documentation/` folder to your Unity project:
23
+
2. Copy the `Documentation/` folder and `DocFxForUnity.csproj`to your Unity project:
24
24
25
25
```diff
26
26
.
27
27
├── Assets
28
+
+ ├── DocFxForUnity.csproj
28
29
+ ├── Documentation
29
30
├── Package
30
31
├── ProjectSettings
31
32
└── README.md
32
33
```
33
34
35
+
You can rename `DocFxForUnity.csproj` to match your project — just update the filename in `Documentation/docfx.json` under `metadata[0].src[0].files` accordingly.
36
+
34
37
3. Edit the following properties in `Documentation/docfx.json`, keep the others as it is:
35
38
36
39
```javascript
@@ -136,25 +139,64 @@ details.
136
139
137
140
- DocFX outputs: `Warning:[ExtractMetadata]No project detected for extracting metadata.`
138
141
139
-
Solution: On Unity, click [Asset > Open C# Project](https://docs.microsoft.com/fr-fr/visualstudio/cross-platform/media/vstu_open-csharp-project.png?view=vs-2019) to generate the required `.csproj`.
142
+
Solution: Make sure you copied `DocFxForUnity.csproj` (or your renamed version) to the root of your Unity project, and that the filename matches the entry in `Documentation/docfx.json` under `metadata[0].src[0].files`.
140
143
141
144
- DocFX outputs: `Warning:[ExtractMetadata]No metadata is generated for Assembly-CSharp,Assembly-CSharp-Editor.`
142
145
143
-
Solution: Make sure your included your namespace in `Documentation/filterConfig.yml`:
146
+
Solution: Make sure you included your namespace in `Documentation/filterConfig.yml`:
144
147
145
148
```yaml
146
149
- include:
147
150
uidRegex: ^Your\.Namespace1
148
151
type: Namespace
149
152
```
150
153
154
+
- MSBuild outputs: `Unity managed DLLs not found.`
155
+
156
+
This means DocFX could not locate Unity's managed DLLs. It looks in three places, in order:
157
+
1. The `UNITY_MANAGED_PATH` environment variable (see below).
158
+
2. `lib/UnityEngine/` at the project root (populated automatically by the CI workflow).
159
+
3. The default Unity Hub installation directory for your OS.
160
+
161
+
If Unity Hub is installed at a non-default location, or you want to target a specific Unity version, set `UNITY_MANAGED_PATH` (see *Advanced: `UNITY_MANAGED_PATH`* below).
162
+
151
163
- If you want to reference a specific version of Unity, change this line on your `docfx.json`:
where `<version>` is a Unity version in the form of `YYYY.x` (*e.g.* 2017.4, 2018.4, 2019.3).
169
+
where `<version>` is a Unity version in the form of `YYYY.x` (*e.g.* 2022.3, 2023.2, 6000.0).
170
+
171
+
## Advanced: `UNITY_MANAGED_PATH`
172
+
173
+
By default, `DocFxForUnity.csproj` auto-detects the Unity managed DLLs from the standard Unity Hub installation directory. Set `UNITY_MANAGED_PATH` when you need to:
174
+
175
+
- Use a Unity version installed at a non-default location.
176
+
- Pin to a specific version when multiple Unity versions are installed.
177
+
- Work without Unity Hub (standalone Unity install).
178
+
179
+
Point it to the `UnityEngine` subfolder inside your Unity installation's `Managed` directory:
180
+
181
+
| OS | Example path |
182
+
|----|-------------|
183
+
| Windows |`C:\Program Files\Unity\Hub\Editor\6000.0.73f1\Editor\Data\Managed\UnityEngine`|
0 commit comments