diff --git a/src/NuGet.Core/NuGet.CommandLine.XPlat/Program.cs b/src/NuGet.Core/NuGet.CommandLine.XPlat/Program.cs index 050b560db0d..186d3afd1ea 100644 --- a/src/NuGet.Core/NuGet.CommandLine.XPlat/Program.cs +++ b/src/NuGet.Core/NuGet.CommandLine.XPlat/Program.cs @@ -11,10 +11,6 @@ using NuGet.Common; using NuGet.Commands; -#if DEBUG -using Microsoft.Build.Locator; -#endif - namespace NuGet.CommandLine.XPlat { internal class Program @@ -43,7 +39,7 @@ public static int MainInternal(string[] args, CommandOutputLogger log) // .NET JIT compiles one method at a time. If this method calls `MSBuildLocator` directly, the // try block is never entered if Microsoft.Build.Locator.dll can't be found. So, run it in a // lambda function to ensure we're in the try block. C# IIFE! - ((Action)(() => MSBuildLocator.RegisterDefaults()))(); + ((Action)(() => Microsoft.Build.Locator.MSBuildLocator.RegisterDefaults()))(); } catch {