161 references to Instance
Microsoft.Build (47)
BackEnd\BuildManager\BuildManager.cs (1)
1306&& BuildEnvironmentHelper.Instance.RunningInVisualStudio
BackEnd\BuildManager\BuildParameters.cs (1)
1024return BuildEnvironmentHelper.Instance.CurrentMSBuildExePath;
BackEnd\Components\BuildRequestEngine\BuildRequestEngine.cs (1)
843if (!NativeMethodsShared.IsWindows || BuildEnvironmentHelper.Instance.RunningInVisualStudio)
BackEnd\Components\Communications\CurrentHost.cs (1)
30string dotnetExe = Path.Combine(FileUtilities.GetFolderAbove(BuildEnvironmentHelper.Instance.CurrentMSBuildToolsDirectory, 2),
BackEnd\Components\Communications\NodeProviderOutOfProc.cs (1)
72CommunicationsUtilities.Trace("MSBUILDNODEHANDSHAKESALT=\"{0}\", msbuildDirectory=\"{1}\", enableNodeReuse={2}, enableLowPriority={3}", Traits.MSBuildNodeHandshakeSalt, BuildEnvironmentHelper.Instance.MSBuildToolsDirectory32, enableNodeReuse, enableLowPriority);
BackEnd\Components\Communications\NodeProviderOutOfProcTaskHost.cs (3)
410s_baseTaskHostPath = BuildEnvironmentHelper.Instance.MSBuildToolsDirectory32; 411s_baseTaskHostPath64 = BuildEnvironmentHelper.Instance.MSBuildToolsDirectory64; 412s_baseTaskHostPathArm64 = BuildEnvironmentHelper.Instance.MSBuildToolsDirectoryArm64;
BackEnd\Components\ProjectCache\CacheContext.cs (1)
51MSBuildExePath = BuildEnvironmentHelper.Instance.CurrentMSBuildExePath;
BackEnd\Components\SdkResolution\DefaultSdkResolver.cs (1)
33string sdkPath = Path.Combine(BuildEnvironmentHelper.Instance.MSBuildSDKsPath, sdk.Name, "Sdk");
BackEnd\Components\SdkResolution\SdkResolverLoader.cs (2)
55Path.Combine(BuildEnvironmentHelper.Instance.MSBuildToolsDirectory32, "SdkResolvers"), location); 82Path.Combine(BuildEnvironmentHelper.Instance.MSBuildToolsDirectoryRoot, "SdkResolvers"), location);
BackEnd\Node\OutOfProcNode.cs (2)
476NativeMethodsShared.SetCurrentDirectory(BuildEnvironmentHelper.Instance.CurrentMSBuildToolsDirectory); 710NativeMethodsShared.SetCurrentDirectory(BuildEnvironmentHelper.Instance.CurrentMSBuildToolsDirectory);
BackEnd\Node\OutOfProcServerNode.cs (2)
252NativeMethodsShared.SetCurrentDirectory(BuildEnvironmentHelper.Instance.CurrentMSBuildToolsDirectory); 426NativeMethodsShared.SetCurrentDirectory(BuildEnvironmentHelper.Instance.CurrentMSBuildToolsDirectory);
BackEnd\Shared\BuildRequestConfiguration.cs (1)
450BuildEnvironmentHelper.Instance.CurrentMSBuildToolsDirectory);
CommunicationsUtilities.cs (1)
103string toolsDirectory = BuildEnvironmentHelper.Instance.MSBuildToolsDirectoryRoot;
Definition\ToolsetConfigurationReader.cs (3)
269if (BuildEnvironmentHelper.Instance.Mode != BuildEnvironmentMode.None && 275FileSystems.Default.FileExists(BuildEnvironmentHelper.Instance.CurrentMSBuildConfigurationFile)) 277var configFile = new ExeConfigurationFileMap { ExeConfigFilename = BuildEnvironmentHelper.Instance.CurrentMSBuildConfigurationFile };
Definition\ToolsetLocalReader.cs (4)
28protected override string MSBuildOverrideTasksPath => BuildEnvironmentHelper.Instance.CurrentMSBuildToolsDirectory; 40yield return new ToolsetPropertyDefinition(MSBuildConstants.ToolsPath, BuildEnvironmentHelper.Instance.CurrentMSBuildToolsDirectory, _sourceLocation); 41yield return new ToolsetPropertyDefinition(MSBuildConstants.SdksPath, BuildEnvironmentHelper.Instance.MSBuildSDKsPath, _sourceLocation); 43System.IO.Path.Combine(BuildEnvironmentHelper.Instance.CurrentMSBuildToolsDirectory, "Roslyn"),
Definition\ToolsetReader.cs (2)
170var currentDir = BuildEnvironmentHelper.Instance.CurrentMSBuildToolsDirectory.TrimEnd(Path.DirectorySeparatorChar); 629Path.Combine(BuildEnvironmentHelper.Instance.CurrentMSBuildToolsDirectory, trimmedValue));
Evaluation\Evaluator.cs (1)
784if (BuildEnvironmentHelper.Instance.RunningInVisualStudio)
Evaluation\IntrinsicFunctions.cs (7)
661return BuildEnvironmentHelper.Instance.CurrentMSBuildToolsDirectory; 666return BuildEnvironmentHelper.Instance.MSBuildToolsDirectory32; 671return BuildEnvironmentHelper.Instance.MSBuildToolsDirectory64; 676return BuildEnvironmentHelper.Instance.MSBuildSDKsPath; 681return BuildEnvironmentHelper.Instance.VisualStudioInstallRootDirectory; 691return BuildEnvironmentHelper.Instance.MSBuildExtensionsPath; 694public static bool IsRunningFromVisualStudio() => BuildEnvironmentHelper.Instance.Mode == BuildEnvironmentMode.VisualStudio;
FrameworkLocationHelper.cs (3)
1045DotNetFrameworkArchitecture.Bitness64 => BuildEnvironmentHelper.Instance.MSBuildToolsDirectory64, 1046DotNetFrameworkArchitecture.Bitness32 => BuildEnvironmentHelper.Instance.MSBuildToolsDirectory32, 1047_ => BuildEnvironmentHelper.Instance.CurrentMSBuildToolsDirectory,
Instance\TaskRegistry.cs (3)
89private static string s_potentialTasksV4Location = Path.Combine(BuildEnvironmentHelper.Instance.CurrentMSBuildToolsDirectory, s_tasksV4Filename); 108private static string s_potentialTasksV12Location = Path.Combine(BuildEnvironmentHelper.Instance.CurrentMSBuildToolsDirectory, s_tasksV12Filename); 127private static string s_potentialTasksCoreLocation = Path.Combine(BuildEnvironmentHelper.Instance.CurrentMSBuildToolsDirectory, s_tasksCoreFilename);
MSBuildLoadContext.cs (1)
99var assemblyNameInExecutableDirectory = Path.Combine(BuildEnvironmentHelper.Instance.CurrentMSBuildToolsDirectory,
Utilities\NuGetFrameworkWrapper.cs (3)
203string assemblyDirectory = BuildEnvironmentHelper.Instance.Mode == BuildEnvironmentMode.VisualStudio ? 204Path.Combine(BuildEnvironmentHelper.Instance.VisualStudioInstallRootDirectory, "Common7", "IDE", "CommonExtensions", "Microsoft", "NuGet") : 205BuildEnvironmentHelper.Instance.CurrentMSBuildToolsDirectory;
Utilities\Utilities.cs (2)
479string extensionsPath = BuildEnvironmentHelper.Instance.CurrentMSBuildToolsDirectory; 553localAppData = BuildEnvironmentHelper.Instance.CurrentMSBuildToolsDirectory;
Microsoft.Build.Engine.UnitTests (113)
BuildEnvironmentHelper_Tests.cs (104)
30string configFilePath = BuildEnvironmentHelper.Instance.CurrentMSBuildConfigurationFile.ToLowerInvariant(); 31string toolsDirectoryPath = BuildEnvironmentHelper.Instance.CurrentMSBuildToolsDirectory.ToLowerInvariant(); 32string actualMSBuildPath = BuildEnvironmentHelper.Instance.CurrentMSBuildExePath.ToLowerInvariant(); 37BuildEnvironmentHelper.Instance.Mode.ShouldBe(BuildEnvironmentMode.Standalone); 52BuildEnvironmentHelper.Instance.CurrentMSBuildToolsDirectory.ShouldBe(path); 53BuildEnvironmentHelper.Instance.CurrentMSBuildExePath.ShouldBe(msBuildPath); 54BuildEnvironmentHelper.Instance.CurrentMSBuildConfigurationFile.ShouldBe(msBuildConfig); 55BuildEnvironmentHelper.Instance.RunningInVisualStudio.ShouldBeFalse(); 56BuildEnvironmentHelper.Instance.VisualStudioInstallRootDirectory.ShouldBeNull(); 57BuildEnvironmentHelper.Instance.RunningTests.ShouldBeFalse(); 58BuildEnvironmentHelper.Instance.Mode.ShouldBe(BuildEnvironmentMode.Standalone); 80BuildEnvironmentHelper.Instance.Mode.ShouldBe(BuildEnvironmentMode.VisualStudio); 81BuildEnvironmentHelper.Instance.MSBuildExtensionsPath.ShouldBe(vsMSBuildDirectory); 82BuildEnvironmentHelper.Instance.CurrentMSBuildToolsDirectory.ShouldBe(msbuildBinDirectory); 83BuildEnvironmentHelper.Instance.CurrentMSBuildExePath.ShouldBe(msBuildPath); 84BuildEnvironmentHelper.Instance.CurrentMSBuildConfigurationFile.ShouldBe(msBuildConfig); 86BuildEnvironmentHelper.Instance.RunningInVisualStudio.ShouldBeFalse(); 87BuildEnvironmentHelper.Instance.VisualStudioInstallRootDirectory.ShouldBe(env.TempFolderRoot); 88BuildEnvironmentHelper.Instance.RunningTests.ShouldBeFalse(); 100BuildEnvironmentHelper.Instance.MSBuildToolsDirectory32.ShouldBe(env.BuildDirectory); 101BuildEnvironmentHelper.Instance.MSBuildToolsDirectory64.ShouldBe(env.BuildDirectory64); 102BuildEnvironmentHelper.Instance.RunningInVisualStudio.ShouldBeFalse(); 103BuildEnvironmentHelper.Instance.RunningTests.ShouldBeFalse(); 104BuildEnvironmentHelper.Instance.Mode.ShouldBe(BuildEnvironmentMode.VisualStudio); 117BuildEnvironmentHelper.Instance.MSBuildToolsDirectory32.ShouldBe(env.BuildDirectory); 118BuildEnvironmentHelper.Instance.MSBuildToolsDirectory64.ShouldBe(env.BuildDirectory); 119BuildEnvironmentHelper.Instance.RunningInVisualStudio.ShouldBeFalse(); 120BuildEnvironmentHelper.Instance.RunningTests.ShouldBeFalse(); 121BuildEnvironmentHelper.Instance.Mode.ShouldBe(BuildEnvironmentMode.Standalone); 133BuildEnvironmentHelper.Instance.MSBuildToolsDirectory32.ShouldBe(env.BuildDirectory); 134BuildEnvironmentHelper.Instance.MSBuildToolsDirectory64.ShouldBe(env.BuildDirectory64); 135BuildEnvironmentHelper.Instance.RunningInVisualStudio.ShouldBeFalse(); 136BuildEnvironmentHelper.Instance.RunningTests.ShouldBeFalse(); 137BuildEnvironmentHelper.Instance.Mode.ShouldBe(BuildEnvironmentMode.VisualStudio); 150BuildEnvironmentHelper.Instance.MSBuildToolsDirectory32.ShouldBe(env.BuildDirectory); 151BuildEnvironmentHelper.Instance.MSBuildToolsDirectory64.ShouldBe(env.BuildDirectory); 152BuildEnvironmentHelper.Instance.RunningInVisualStudio.ShouldBeFalse(); 153BuildEnvironmentHelper.Instance.RunningTests.ShouldBeFalse(); 154BuildEnvironmentHelper.Instance.Mode.ShouldBe(BuildEnvironmentMode.Standalone); 167BuildEnvironmentHelper.Instance.MSBuildToolsDirectory32.ShouldBe(env.BuildDirectory); 168BuildEnvironmentHelper.Instance.MSBuildToolsDirectory64.ShouldBe(env.BuildDirectory); 169BuildEnvironmentHelper.Instance.RunningInVisualStudio.ShouldBeFalse(); 170BuildEnvironmentHelper.Instance.RunningTests.ShouldBeFalse(); 171BuildEnvironmentHelper.Instance.Mode.ShouldBe(BuildEnvironmentMode.Standalone); 184Path.GetFileName(BuildEnvironmentHelper.Instance.CurrentMSBuildExePath).ShouldBe(MSBuildExeName); 186BuildEnvironmentHelper.Instance.MSBuildToolsDirectory32.ShouldBe(env.BuildDirectory); 187BuildEnvironmentHelper.Instance.MSBuildToolsDirectory64.ShouldBe(env.BuildDirectory); 188BuildEnvironmentHelper.Instance.RunningInVisualStudio.ShouldBeFalse(); 189BuildEnvironmentHelper.Instance.RunningTests.ShouldBeFalse(); 190BuildEnvironmentHelper.Instance.Mode.ShouldBe(BuildEnvironmentMode.Standalone); 202BuildEnvironmentHelper.Instance.MSBuildToolsDirectory32.ShouldBe(env.BuildDirectory); 203BuildEnvironmentHelper.Instance.MSBuildToolsDirectory64.ShouldBe(env.BuildDirectory64); 204BuildEnvironmentHelper.Instance.VisualStudioInstallRootDirectory.ShouldBe(env.TempFolderRoot); 205BuildEnvironmentHelper.Instance.RunningInVisualStudio.ShouldBeTrue(); 206BuildEnvironmentHelper.Instance.RunningTests.ShouldBeFalse(); 207BuildEnvironmentHelper.Instance.Mode.ShouldBe(BuildEnvironmentMode.VisualStudio); 224BuildEnvironmentHelper.Instance.VisualStudioInstallRootDirectory.ShouldBe(env.TempFolderRoot); 225BuildEnvironmentHelper.Instance.Mode.ShouldBe(BuildEnvironmentMode.VisualStudio); 230BuildEnvironmentHelper.Instance.VisualStudioInstallRootDirectory.ShouldBeNull(); 231BuildEnvironmentHelper.Instance.Mode.ShouldBe(BuildEnvironmentMode.None); 244BuildEnvironmentHelper.Instance.VisualStudioInstallRootDirectory.ShouldBe(env.TempFolderRoot); 245BuildEnvironmentHelper.Instance.Mode.ShouldBe(BuildEnvironmentMode.VisualStudio); 257BuildEnvironmentHelper.Instance.VisualStudioInstallRootDirectory.ShouldBe(env.TempFolderRoot); 258BuildEnvironmentHelper.Instance.Mode.ShouldBe(BuildEnvironmentMode.VisualStudio); 278BuildEnvironmentHelper.Instance.VisualStudioInstallRootDirectory.ShouldBe(env.TempFolderRoot); 279BuildEnvironmentHelper.Instance.Mode.ShouldBe(BuildEnvironmentMode.VisualStudio); 284BuildEnvironmentHelper.Instance.VisualStudioInstallRootDirectory.ShouldBeNull(); 285BuildEnvironmentHelper.Instance.Mode.ShouldBe(BuildEnvironmentMode.None); 301BuildEnvironmentHelper.Instance.VisualStudioInstallRootDirectory.ShouldBeNull(); 302BuildEnvironmentHelper.Instance.Mode.ShouldBe(BuildEnvironmentMode.None); 309BuildEnvironmentHelper.Instance.RunningTests.ShouldBeTrue(); 310BuildEnvironmentHelper.Instance.RunningInVisualStudio.ShouldBeFalse(); 320BuildEnvironmentHelper.Instance.RunningInVisualStudio.ShouldBeTrue(); 321BuildEnvironmentHelper.Instance.VisualStudioInstallRootDirectory.ShouldBe(env.TempFolderRoot); 322BuildEnvironmentHelper.Instance.Mode.ShouldBe(BuildEnvironmentMode.VisualStudio); 333BuildEnvironmentHelper.Instance.RunningInVisualStudio.ShouldBeTrue(); 334BuildEnvironmentHelper.Instance.VisualStudioInstallRootDirectory.ShouldBe(env.TempFolderRoot); 335BuildEnvironmentHelper.Instance.Mode.ShouldBe(BuildEnvironmentMode.VisualStudio); 347BuildEnvironmentHelper.Instance.MSBuildToolsDirectory32.ShouldBe(env.BuildDirectory); 348BuildEnvironmentHelper.Instance.MSBuildToolsDirectory64.ShouldBe(env.BuildDirectory64); 349BuildEnvironmentHelper.Instance.Mode.ShouldBe(BuildEnvironmentMode.VisualStudio); 363BuildEnvironmentHelper.Instance.MSBuildToolsDirectory32.ShouldBe(env.BuildDirectory); 364BuildEnvironmentHelper.Instance.MSBuildToolsDirectory64.ShouldBe(Path.Combine(env.BuildDirectory, "amd64")); 365BuildEnvironmentHelper.Instance.VisualStudioInstallRootDirectory.ShouldBeNull(); 366BuildEnvironmentHelper.Instance.Mode.ShouldBe(BuildEnvironmentMode.Standalone); 379BuildEnvironmentHelper.Instance.MSBuildToolsDirectory32.ShouldBe(env.BuildDirectory); 380BuildEnvironmentHelper.Instance.MSBuildToolsDirectory64.ShouldBe(Path.Combine(env.BuildDirectory, "amd64")); 381BuildEnvironmentHelper.Instance.Mode.ShouldBe(BuildEnvironmentMode.Standalone); 393BuildEnvironmentHelper.Instance.MSBuildToolsDirectory32.ShouldBe(env.BuildDirectory); 394BuildEnvironmentHelper.Instance.MSBuildToolsDirectory64.ShouldBe(env.BuildDirectory64); 395BuildEnvironmentHelper.Instance.VisualStudioInstallRootDirectory.ShouldBe(env.TempFolderRoot); 396BuildEnvironmentHelper.Instance.Mode.ShouldBe(BuildEnvironmentMode.VisualStudio); 409BuildEnvironmentHelper.Instance.CurrentMSBuildExePath.ShouldBe(entryProcess); 410BuildEnvironmentHelper.Instance.CurrentMSBuildToolsDirectory.ShouldBe(Path.GetDirectoryName(entryProcess)); 411BuildEnvironmentHelper.Instance.VisualStudioInstallRootDirectory.ShouldBeNull(); 412BuildEnvironmentHelper.Instance.Mode.ShouldBe(BuildEnvironmentMode.None); 426BuildEnvironmentHelper.Instance.MSBuildToolsDirectory32.ShouldBe(env.BuildDirectory); 427BuildEnvironmentHelper.Instance.MSBuildToolsDirectory64.ShouldBe(env.BuildDirectory64); 428BuildEnvironmentHelper.Instance.VisualStudioInstallRootDirectory.ShouldBe(env.TempFolderRoot); 429BuildEnvironmentHelper.Instance.Mode.ShouldBe(BuildEnvironmentMode.VisualStudio); 443BuildEnvironmentHelper.Instance.MSBuildToolsDirectory32.ShouldBe(env.BuildDirectory); 444BuildEnvironmentHelper.Instance.MSBuildToolsDirectory64.ShouldBe(env.BuildDirectory64); 445BuildEnvironmentHelper.Instance.VisualStudioInstallRootDirectory.ShouldBe(env.TempFolderRoot); 446BuildEnvironmentHelper.Instance.Mode.ShouldBe(BuildEnvironmentMode.VisualStudio);
Instance\ProjectInstance_Internal_Tests.cs (1)
567Directory.SetCurrentDirectory(BuildEnvironmentHelper.Instance.CurrentMSBuildToolsDirectory);
ProjectCache\ProjectCacheTests.cs (4)
54BuildEnvironmentHelper.Instance.CurrentMSBuildToolsDirectory, 551var currentBuildEnvironment = BuildEnvironmentHelper.Instance; 660var currentBuildEnvironment = BuildEnvironmentHelper.Instance; 1437var currentBuildEnvironment = BuildEnvironmentHelper.Instance;
TypeLoader_Dependencies_Tests.cs (1)
17private static readonly string ProjectFileFolder = Path.Combine(BuildEnvironmentHelper.Instance.CurrentMSBuildToolsDirectory, "TaskWithDependency");
TypeLoader_Tests.cs (3)
21private static readonly string ProjectFileFolder = Path.Combine(BuildEnvironmentHelper.Instance.CurrentMSBuildToolsDirectory, "PortableTask"); 25Path.Combine(BuildEnvironmentHelper.Instance.CurrentMSBuildToolsDirectory, "..", "..", "..", "Samples", "PortableTask")); 75string dllPath = Path.Combine(BuildEnvironmentHelper.Instance.CurrentMSBuildToolsDirectory, dllName);
Microsoft.Build.UnitTests.Shared (1)
RunnerUtilities.cs (1)
19public static string PathToCurrentlyRunningMsBuildExe => BuildEnvironmentHelper.Instance.CurrentMSBuildExePath;