Commit ca5a917
committed
[dotnet-run] fix logging and
c164a9b is mostly working with two issues I've discovered while testing:
1. If `ComputeAvailableDevices` requires `Restore` to have run (which
is actually the case for iOS and Android), `dotnet run` would fail
unless you did an explicit `dotnet restore` first:
D:\src\helloandroid> D:\src\dotnet\sdk\artifacts\bin\redist\Debug\dotnet\dotnet.exe run -bl
failed with 1 error(s) (0.1s)
D:\src\dotnet\sdk\artifacts\bin\redist\Debug\dotnet\sdk\11.0.100-dev\Sdks\Microsoft.NET.Sdk\targets\Microsoft.PackageDependencyResolution.targets(266,5): error NETSDK1004: Assets file 'D:\src\helloandroid\obj\project.assets.json' not found. Run a NuGet package restore to generate this file.
We can test this by changing `DotnetRunDevices.csproj`:
<Target Name="ComputeAvailableDevices" DependsOnTargets="ResolveFrameworkReferences">
Doing an explicit `Restore` step before `ComputeAvailableDevices`
resolves this.
2. We were not passing loggers `ProjectInstance.Build()` calls in
`RunCommandSelector`, so no logging output was shown during device
computation. This is now fixed by creating a fresh console logger
each time we call `Build()`.
I tested this manually with a console app with a
`ComputeAvailableDevices` target and a lengthy sleep:
helloconsole ComputeAvailableDevices (9.1s)Restore for device selection1 parent adbbd10 commit ca5a917
File tree
3 files changed
+60
-11
lines changed- src/Cli/dotnet/Commands/Run
- test/TestAssets/TestProjects/DotnetRunDevices
3 files changed
+60
-11
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
96 | 96 | | |
97 | 97 | | |
98 | 98 | | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
99 | 105 | | |
100 | 106 | | |
101 | 107 | | |
| |||
257 | 263 | | |
258 | 264 | | |
259 | 265 | | |
260 | | - | |
| 266 | + | |
261 | 267 | | |
262 | 268 | | |
263 | 269 | | |
| |||
284 | 290 | | |
285 | 291 | | |
286 | 292 | | |
| 293 | + | |
287 | 294 | | |
288 | | - | |
| 295 | + | |
| 296 | + | |
289 | 297 | | |
290 | 298 | | |
291 | 299 | | |
| |||
296 | 304 | | |
297 | 305 | | |
298 | 306 | | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
299 | 310 | | |
300 | 311 | | |
301 | 312 | | |
| |||
474 | 485 | | |
475 | 486 | | |
476 | 487 | | |
477 | | - | |
| 488 | + | |
478 | 489 | | |
479 | 490 | | |
480 | 491 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
9 | 10 | | |
10 | 11 | | |
11 | 12 | | |
| |||
26 | 27 | | |
27 | 28 | | |
28 | 29 | | |
| 30 | + | |
29 | 31 | | |
30 | 32 | | |
31 | 33 | | |
| |||
39 | 41 | | |
40 | 42 | | |
41 | 43 | | |
| 44 | + | |
42 | 45 | | |
43 | 46 | | |
44 | 47 | | |
45 | 48 | | |
46 | 49 | | |
| 50 | + | |
47 | 51 | | |
48 | 52 | | |
49 | 53 | | |
| |||
119 | 123 | | |
120 | 124 | | |
121 | 125 | | |
122 | | - | |
| 126 | + | |
123 | 127 | | |
124 | 128 | | |
125 | 129 | | |
| |||
216 | 220 | | |
217 | 221 | | |
218 | 222 | | |
| 223 | + | |
219 | 224 | | |
| 225 | + | |
220 | 226 | | |
221 | | - | |
| 227 | + | |
222 | 228 | | |
223 | 229 | | |
| 230 | + | |
224 | 231 | | |
225 | 232 | | |
226 | 233 | | |
| |||
234 | 241 | | |
235 | 242 | | |
236 | 243 | | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
237 | 261 | | |
238 | 262 | | |
239 | 263 | | |
240 | | - | |
| 264 | + | |
241 | 265 | | |
242 | 266 | | |
243 | 267 | | |
| |||
274 | 298 | | |
275 | 299 | | |
276 | 300 | | |
| 301 | + | |
277 | 302 | | |
278 | 303 | | |
| 304 | + | |
279 | 305 | | |
280 | 306 | | |
281 | 307 | | |
| 308 | + | |
282 | 309 | | |
283 | | - | |
| 310 | + | |
| 311 | + | |
284 | 312 | | |
285 | 313 | | |
286 | 314 | | |
| 315 | + | |
287 | 316 | | |
288 | 317 | | |
289 | | - | |
| 318 | + | |
290 | 319 | | |
291 | 320 | | |
292 | 321 | | |
| |||
356 | 385 | | |
357 | 386 | | |
358 | 387 | | |
359 | | - | |
360 | | - | |
361 | 388 | | |
362 | 389 | | |
363 | 390 | | |
| |||
433 | 460 | | |
434 | 461 | | |
435 | 462 | | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
436 | 474 | | |
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
| 8 | + | |
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| |||
0 commit comments