From 8bd695f889727be30b9d679464a828c302908abc Mon Sep 17 00:00:00 2001 From: Joey Robichaud Date: Mon, 28 Aug 2023 19:10:37 -0700 Subject: [PATCH] Include the project file name when invoking `dotnet build` --- src/OmniSharp.DotNetTest/VSTestManager.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/OmniSharp.DotNetTest/VSTestManager.cs b/src/OmniSharp.DotNetTest/VSTestManager.cs index 479f89f969..807a60560f 100644 --- a/src/OmniSharp.DotNetTest/VSTestManager.cs +++ b/src/OmniSharp.DotNetTest/VSTestManager.cs @@ -86,8 +86,10 @@ protected override bool PrepareToConnect(bool noBuild) return true; } + var projectFileName = Path.GetFileName(Project.FilePath); + // The project must be built before we can test. - var arguments = "build"; + var arguments = $"build {projectFileName}"; // If this is .NET CLI version 2.0.0 or greater, we also specify --no-restore to ensure that // implicit restore on build doesn't slow the build down.