Closed 0xced closed 9 months ago
Awesome! How on earth did you find that? :tada:
Well, I've become kind of an MSBuild expert in spite of myself over the years. The /_/
path was a great hint towards SourceLink, so I looked at SourceLink related stuff with MSBuild Binary and Structured Log Viewer (thanks again @KirillOsenkov 🙏) and eventually discovered this property.
Also, I was pretty motivated because I already had spend way too much figuring out how to run test in parallel across target frameworks. 😄
Yes, .NET 8 enabled SourceLink by default. Happy the tool is helpful!
This reduces the tests execution time in half. On my machine: 76 seconds when run in parallel vs 144 seconds when run serially.
The fix introduced in 41bc33d4bc7b03c920102ddaba195e96d152fb5f (running
dotnet test
on the csproj rather then on the built dlls) was problematic for two reasons.Serilog.Settings.Configuration.Tests.csproj
in Debug instead of Release and it's unnecessary since it was previously built.The right fix was to disable deterministic source paths for the test project with
<DeterministicSourcePaths>false</DeterministicSourcePaths>
. This way, the[CallerFilePath]
attribute works as expected with absolute paths on the current machine instead of being substituted with/_/
(which was causing the test failures). This looks like a breaking change that was introduced in the .NET 8 SDK.Also, I added back allowPrerelease = false and rollForward = latestFeature in the global.json file.