The issue arises because the /p option is a build property that is passed to the build phase of dotnet test. However, when running tests directly from a DLL (e.g., MyProject.dll), the dotnet test command skips the build phase entirely. Consequently, build properties such as /p:CollectCoverage=true are not applicable.