432 references to IsWindows
Microsoft.Build (47)
BackEnd\BuildManager\BuildManager.cs (1)
471if (NativeMethodsShared.IsWindows || parameters.LowPriority)
BackEnd\Components\BuildRequestEngine\BuildRequestEngine.cs (1)
840if (!NativeMethodsShared.IsWindows || BuildEnvironmentHelper.Instance.RunningInVisualStudio)
BackEnd\Components\Communications\CurrentHost.cs (1)
31NativeMethodsShared.IsWindows ? "dotnet.exe" : "dotnet");
BackEnd\Components\Communications\NodeLauncher.cs (1)
101if (!NativeMethodsShared.IsWindows)
BackEnd\Node\OutOfProcNode.cs (1)
857if (!lowPriority || NativeMethodsShared.IsWindows)
BackEnd\Node\OutOfProcServerNode.cs (1)
391if (NativeMethodsShared.IsWindows && command.ConsoleConfiguration.BufferWidth > 0)
BuildEnvironmentHelper.cs (3)
139if (!NativeMethodsShared.IsWindows) 171if (NativeMethodsShared.IsWindows && 244if (NativeMethodsShared.IsWindows &&
CommunicationsUtilities.cs (1)
517if (!NativeMethodsShared.IsWindows)
Evaluation\Evaluator.cs (1)
1144if (!NativeMethodsShared.IsWindows)
Evaluation\Expander.cs (2)
1649if (!NativeMethodsShared.IsWindows || !ChangeWaves.AreFeaturesEnabled(ChangeWaves.Wave17_4)) 1689if (!NativeMethodsShared.IsWindows && !registryKeyName.StartsWith("HKEY_CURRENT_USER", StringComparison.OrdinalIgnoreCase))
Evaluation\IntrinsicFunctions.cs (5)
196if (!NativeMethodsShared.IsWindows || !ChangeWaves.AreFeaturesEnabled(ChangeWaves.Wave17_4)) 213if (!NativeMethodsShared.IsWindows || !ChangeWaves.AreFeaturesEnabled(ChangeWaves.Wave17_4)) 227if (!NativeMethodsShared.IsWindows || !ChangeWaves.AreFeaturesEnabled(ChangeWaves.Wave17_4)) 250if (!NativeMethodsShared.IsWindows || !ChangeWaves.AreFeaturesEnabled(ChangeWaves.Wave17_4)) 281if (!NativeMethodsShared.IsWindows && !keyName.StartsWith("HKEY_CURRENT_USER", StringComparison.OrdinalIgnoreCase))
FileMatcher.cs (2)
1259bool isUncPath = NativeMethodsShared.IsWindows && fixedDir.Length > 1 2255if (NativeMethodsShared.IsWindows &&
FileSystems.cs (1)
20if (NativeMethodsShared.IsWindows)
FileUtilities.cs (4)
564if (NativeMethodsShared.IsWindows || string.IsNullOrEmpty(value) 585if (NativeMethodsShared.IsWindows || value.IsEmpty) 670if (NativeMethodsShared.IsWindows) 764if (NativeMethodsShared.IsWindows && !EndsWithSlash(fullPath))
FrameworkLocationHelper.cs (14)
90internal static string dotNetFrameworkVersionFolderPrefixV11 = NativeMethodsShared.IsWindows ? "v1.1" : "1.1"; // v1.1 is for Everett. 95internal static string dotNetFrameworkVersionFolderPrefixV20 = NativeMethodsShared.IsWindows ? "v2.0" : "2.0"; // v2.0 is for Whidbey. 99internal static string dotNetFrameworkVersionFolderPrefixV30 = NativeMethodsShared.IsWindows ? "v3.0" : "3.0"; // v3.0 is for WinFx. 113internal static string dotNetFrameworkVersionFolderPrefixV35 = NativeMethodsShared.IsWindows ? "v3.5" : "3.5"; // v3.5 is for Orcas. 119internal static string dotNetFrameworkVersionFolderPrefixV40 = NativeMethodsShared.IsWindows ? "v4.0" : "4.0"; 120internal static string dotNetFrameworkVersionFolderPrefixV45 = NativeMethodsShared.IsWindows ? "v4.5" : "4.5"; 503if (!NativeMethodsShared.IsWindows) 553if (NativeMethodsShared.IsWindows) 600if (NativeMethodsShared.IsWindows) 774if (!NativeMethodsShared.IsWindows) 928combinedPath = NativeMethodsShared.IsWindows 1142dotNetFrameworkVersionFolderPrefix: NativeMethodsShared.IsWindows ? "v4.0" : "v4.5", 1395(!FileSystems.Default.FileExists(Path.Combine(generatedPathToDotNetFramework, NativeMethodsShared.IsWindows ? "MSBuild.exe" : "mcs.exe")) && 1514if (NativeMethodsShared.IsWindows)
Instance\HostServices.cs (1)
90if (NativeMethodsShared.IsWindows)
Instance\RunningObjectTable.cs (1)
26if (!NativeMethodsShared.IsWindows)
Logging\BaseConsoleLogger.cs (1)
265runningWithCharacterFileType = NativeMethodsShared.IsWindows && ConsoleConfiguration.OutputIsScreen;
Logging\InProcessConsoleConfiguration.cs (2)
27if (NativeMethodsShared.IsWindows && !Console.IsOutputRedirected) 78if (NativeMethodsShared.IsWindows)
ManagedFileSystem.cs (1)
26return NativeMethodsShared.IsWindows;
Modifiers.cs (1)
464if (NativeMethodsShared.IsWindows)
TempFileUtilities.cs (1)
42string msbuildTempFolder = NativeMethodsShared.IsWindows ?
Microsoft.Build.CommandLine.UnitTests (10)
XMake_Tests.cs (10)
1165NativeMethodsShared.IsWindows ? @"c:\bin\msbuild.exe" : "/msbuild.exe", 1192private readonly string _pathToArbitraryBogusFile = NativeMethodsShared.IsWindows // OK on 64 bit as well 1202var msbuildParameters = "\"" + _pathToArbitraryBogusFile + "\"" + (NativeMethodsShared.IsWindows ? " /v:diag" : " -v:diag"); 1208output.ShouldContain(RunnerUtilities.PathToCurrentlyRunningMsBuildExe + (NativeMethodsShared.IsWindows ? " /v:diag " : " -v:diag ") + _pathToArbitraryBogusFile, Case.Insensitive); 1217var msbuildParameters = "\"" + _pathToArbitraryBogusFile + "\"" + (NativeMethodsShared.IsWindows ? " /v:diag" : " -v:diag"); 1223if (NativeMethodsShared.IsWindows) 1231output.ShouldContain(RunnerUtilities.PathToCurrentlyRunningMsBuildExe + (NativeMethodsShared.IsWindows ? " /v:diag " : " -v:diag ") + _pathToArbitraryBogusFile, Case.Insensitive); 1247var msbuildParameters = "\"" + _pathToArbitraryBogusFile + "\"" + (NativeMethodsShared.IsWindows ? " /v:diag" : " -v:diag"); 1257output.ShouldContain(RunnerUtilities.PathToCurrentlyRunningMsBuildExe + (NativeMethodsShared.IsWindows ? " /v:diag " : " -v:diag ") + _pathToArbitraryBogusFile, Case.Insensitive); 2120fileLoggerParameters = new[] { "Parameter1", "verbosity=Normal;logfile=" + (NativeMethodsShared.IsWindows ? "c:\\temp\\cat.log" : "/tmp/cat.log") };
Microsoft.Build.Engine.OM.UnitTests (44)
BuildEnvironmentHelper.cs (3)
139if (!NativeMethodsShared.IsWindows) 171if (NativeMethodsShared.IsWindows && 244if (NativeMethodsShared.IsWindows &&
Construction\WhiteSpacePreservation_Tests.cs (1)
449if (NativeMethodsShared.IsWindows)
Definition\DefinitionEditing_Tests.cs (9)
331NativeMethodsShared.IsWindows 524NativeMethodsShared.IsWindows ? @"c:\subdir1\**\subdir2\**\*.x?x" : "/subdir1/**/subdir2/**/*.x?x"); 530NativeMethodsShared.IsWindows ? @"c:\subdir1\a\b\subdir2\c\i1.xyx" : "/subdir1/a/b/subdir2/c/i1.xyx")[ 534NativeMethodsShared.IsWindows ? 1520xml.AddImport(NativeMethodsShared.IsWindows ? 2249NativeMethodsShared.IsWindows ? @"c:\" + Guid.NewGuid().ToString() + @"\**\i1" : "/" + Guid.NewGuid().ToString() + "/**/i1"); 2439NativeMethodsShared.IsWindows ? @"c:\subdir1\**\subdir2\**\*.x?x" : "/subdir1/**/subdir2/**/*.x?x"); 2443NativeMethodsShared.IsWindows ? @"c:\subdir1\a\b\subdir2\c\i1.xyx" : "/subdir1/a/b/subdir2/c/i1.xyx")[0].Xml; 2446NativeMethodsShared.IsWindows ?
Definition\Project_Tests.cs (2)
44private readonly int RootPrefixLength = NativeMethodsShared.IsWindows ? 3 : 1; 676if (NativeMethodsShared.IsWindows)
Definition\ProjectCollection_Tests.cs (1)
409string projectDirectory = NativeMethodsShared.IsWindows ? "c:\\1" : "/l";
Definition\ProjectItem_Tests.cs (12)
285NativeMethodsShared.IsWindows ? @"<i Include='c:\foo\bar.baz'/>" : @"<i Include='/foo/bar.baz'/>"); 299NativeMethodsShared.IsWindows ? @"c:\foo\bar.baz" : "/foo/bar.baz", 301Assert.Equal(NativeMethodsShared.IsWindows ? @"c:\" : "/", item.GetMetadataValue("RootDir")); 304Assert.Equal(NativeMethodsShared.IsWindows ? @"c:\foo\" : "/foo/", item.GetMetadataValue("RelativeDir")); 305Assert.Equal(NativeMethodsShared.IsWindows ? @"foo\" : "foo/", item.GetMetadataValue("Directory")); 308NativeMethodsShared.IsWindows ? @"c:\foo\bar.baz" : "/foo/bar.baz", 370"<i Include='" + directory + (NativeMethodsShared.IsWindows ? @"\**\*'/>" : "/**/*'/>")); 372Assert.Equal(NativeMethodsShared.IsWindows ? @"b\" : "b/", item.GetMetadataValue("RecursiveDir")); 415IList<ProjectItem> items = ObjectModelHelpers.GetItemsFromFragment("<i Include='i0;" + directory + (NativeMethodsShared.IsWindows ? @"\**\*;i2'/>" : "/**/*;i2'/>")); 419Assert.Equal(NativeMethodsShared.IsWindows ? @"b\" : "b/", items[1].GetMetadataValue("RecursiveDir")); 752if (NativeMethodsShared.IsWindows) 1646<i Include='i1.cpp;" + (NativeMethodsShared.IsWindows ? @"c:\bar\i2.cpp" : "/bar/i2.cpp") + @"'>
Definition\ProjectItemDefinition_Tests.cs (4)
240<i Include='" + (NativeMethodsShared.IsWindows ? @"c:\a\b.ext" : "/a/b.ext") + @"'/> 266<i Include='" + (NativeMethodsShared.IsWindows ? @"c:\a\b.ext" : "/a/b.ext") + @"'/> 292<i Include='" + (NativeMethodsShared.IsWindows ? @"c:\a\b.ext" : "/a/b.ext") + @"'/> 320<i Include='" + (NativeMethodsShared.IsWindows ? @"c:\a\b.ext" : "/a/b.ext") + @"'>
Definition\ProjectProperty_Tests.cs (2)
155string varName = NativeMethodsShared.IsWindows ? "username" : "USER"; 178string varName = NativeMethodsShared.IsWindows ? "username" : "USER";
FileSystems.cs (1)
20if (NativeMethodsShared.IsWindows)
FileUtilities.cs (4)
564if (NativeMethodsShared.IsWindows || string.IsNullOrEmpty(value) 585if (NativeMethodsShared.IsWindows || value.IsEmpty) 670if (NativeMethodsShared.IsWindows) 764if (NativeMethodsShared.IsWindows && !EndsWithSlash(fullPath))
Instance\ProjectInstance_Tests.cs (3)
895instance.GetProperty(NativeMethodsShared.IsWindows ? "username" : "USER").EvaluatedValue = 920instance.GetProperty(NativeMethodsShared.IsWindows ? "username" : "USER").EvaluatedValue = 942instance.GetProperty(NativeMethodsShared.IsWindows ? "username" : "USER").EvaluatedValue =
Instance\ProjectItemInstance_Tests.cs (1)
757<i Include='i1.cpp;" + (NativeMethodsShared.IsWindows ? @"c:\bar\i2.cpp" : "/bar/i2.cpp") + @"'>
TempFileUtilities.cs (1)
42string msbuildTempFolder = NativeMethodsShared.IsWindows ?
Microsoft.Build.Engine.UnitTests (86)
BackEnd\BuildRequestConfiguration_Tests.cs (1)
535if (!NativeMethodsShared.IsWindows)
ConsoleLogger_Tests.cs (1)
2381bool runningWithCharDevice = NativeMethodsShared.IsWindows ? IsRunningWithCharacterFileType() : false;
Construction\SolutionFile_Tests.cs (5)
35p.FullPath = NativeMethodsShared.IsWindows ? "c:\\foo.sln" : "/foo.sln"; 76p.FullPath = NativeMethodsShared.IsWindows ? "c:\\foo.sln" : "/foo.sln"; 95p.FullPath = NativeMethodsShared.IsWindows ? "c:\\foo.sln" : "/foo.sln"; 115p.FullPath = NativeMethodsShared.IsWindows ? "c:\\foo.sln" : "/foo.sln"; 678p.FullPath = NativeMethodsShared.IsWindows ? "c:\\foo.sln" : "/foo.sln";
Definition\Toolset_Tests.cs (1)
55if (NativeMethodsShared.IsWindows)
Definition\ToolsetConfigurationReader_Tests.cs (1)
567if (NativeMethodsShared.IsWindows)
Definition\ToolsVersion_Tests.cs (18)
33string dir = NativeMethodsShared.IsWindows ? "c:\\directory1\\directory2" : "/directory1/directory2"; 34string overrideDir = NativeMethodsShared.IsWindows ? "c:\\msbuildoverridetasks" : "/msbuildoverridetasks"; 148NativeMethodsShared.IsWindows ? "c:\\directory1\\directory2" : "/directory1/directory2", 224string dir = NativeMethodsShared.IsWindows ? "c:\\directory1\\directory2" : "/directory1/directory2"; 225string overrideDir = NativeMethodsShared.IsWindows ? "c:\\msbuildoverridetasks" : "/msbuildoverridetasks"; 889NativeMethodsShared.IsWindows ? "c:\\inline" : "/inline", 954new DefaultTasksFile(NativeMethodsShared.IsWindows 963new DefaultTasksFile(NativeMethodsShared.IsWindows 969new DefaultTasksFile(NativeMethodsShared.IsWindows 975new DefaultTasksFile(NativeMethodsShared.IsWindows 981new DefaultTasksFile(NativeMethodsShared.IsWindows 987new DefaultTasksFile(NativeMethodsShared.IsWindows 993new DefaultTasksFile(NativeMethodsShared.IsWindows 1001new DefaultTasksFile(NativeMethodsShared.IsWindows 1009new DefaultTasksFile(NativeMethodsShared.IsWindows 1015new DefaultTasksFile(NativeMethodsShared.IsWindows 1028new DefaultTasksFile(NativeMethodsShared.IsWindows 1037new DefaultTasksFile(NativeMethodsShared.IsWindows
Evaluation\Evaluator_Tests.cs (12)
122string fooPath = NativeMethodsShared.IsWindows ? @"c:\temp\foo.import" : "/temp/foo.import"; 123string barPath = NativeMethodsShared.IsWindows ? @"c:\temp\bar.import" : "/temp/bar.import"; 1301string targets1FileName = NativeMethodsShared.IsWindows ? @"c:\a\t1.targets" : "/a/t1.targets"; 1302string aDirName = NativeMethodsShared.IsWindows ? @"c:\a\" : "/a/"; 1303string targets2FileName = NativeMethodsShared.IsWindows ? @"c:\a\b\t2.targets" : "/a/b/t2.targets"; 1304string bDirName = NativeMethodsShared.IsWindows ? @"c:\a\b\" : "/a/b/"; 1305string targets3FileName = NativeMethodsShared.IsWindows ? @"c:\t3.targets" : "/t3.targets"; 1306string rootDirName = NativeMethodsShared.IsWindows ? @"c:\" : "/"; 1307string aProjName = NativeMethodsShared.IsWindows ? @"c:\a\p.proj" : "/a/p.proj"; 2702string file = NativeMethodsShared.IsWindows ? @"c:\foo\bar.csproj" : "/foo/bar.csproj"; 2721string file = NativeMethodsShared.IsWindows ? @"c:\bar.csproj" : "/bar.csproj"; 2722string dir = NativeMethodsShared.IsWindows ? @"c:\" : "/";
Evaluation\Expander_Tests.cs (10)
41private static readonly string s_rootPathPrefix = NativeMethodsShared.IsWindows ? "C:\\" : Path.VolumeSeparatorChar.ToString(); 1315NativeMethodsShared.IsWindows ? @"subdir1\engine.dll" : "subdir1/engine.dll", project.FullPath); 1319NativeMethodsShared.IsWindows ? @"subdir2\tasks.dll" : "subdir2/tasks.dll", project.FullPath); 1805string envVar = NativeMethodsShared.IsWindows ? "TEMP" : "USER"; 3760string envVar = NativeMethodsShared.IsWindows ? "TEMP" : "USER"; 3784string envVar = NativeMethodsShared.IsWindows ? "TEMP" : "USER"; 3808string envVar = NativeMethodsShared.IsWindows ? "TEMP" : "USER"; 3832string envVar = NativeMethodsShared.IsWindows ? "TEMP" : "USER"; 4228if (NativeMethodsShared.IsWindows) 4233if (!NativeMethodsShared.IsWindows)
Evaluation\ItemEvaluation_Tests.cs (1)
604if (!NativeMethodsShared.IsWindows)
Evaluation\ItemSpec_Tests.cs (1)
42var absoluteRootPath = NativeMethodsShared.IsWindows
FileMatcher_Tests.cs (17)
1004if (NativeMethodsShared.IsWindows) 1018NativeMethodsShared.IsWindows ? "f:\\dir1\\dir2\\file.txt" : "/dir1/dir2/file.txt", 1019NativeMethodsShared.IsWindows ? "f:\\dir1\\dir2\\file.txt" : "/dir1/dir2/file.txt", 1446string[] strings = new string[1] { NativeMethodsShared.IsWindows ? "c:\\1.file" : "/1.file" }; 1447strings = FileMatcher.RemoveProjectDirectory(strings, NativeMethodsShared.IsWindows ? "c:\\" : "/").ToArray(); 1450strings = new string[1] { NativeMethodsShared.IsWindows ? "c:\\directory\\1.file" : "/directory/1.file" }; 1451strings = FileMatcher.RemoveProjectDirectory(strings, NativeMethodsShared.IsWindows ? "c:\\" : "/").ToArray(); 1452Assert.Equal(strings[0], NativeMethodsShared.IsWindows ? "directory\\1.file" : "directory/1.file"); 1454strings = new string[1] { NativeMethodsShared.IsWindows ? "c:\\directory\\1.file" : "/directory/1.file" }; 1455strings = FileMatcher.RemoveProjectDirectory(strings, NativeMethodsShared.IsWindows ? "c:\\directory" : "/directory").ToArray(); 1458strings = new string[1] { NativeMethodsShared.IsWindows ? "c:\\1.file" : "/1.file" }; 1459strings = FileMatcher.RemoveProjectDirectory(strings, NativeMethodsShared.IsWindows ? "c:\\directory" : "/directory").ToArray(); 1460Assert.Equal(strings[0], NativeMethodsShared.IsWindows ? "c:\\1.file" : "/1.file"); 1462strings = new string[1] { NativeMethodsShared.IsWindows ? "c:\\directorymorechars\\1.file" : "/directorymorechars/1.file" }; 1463strings = FileMatcher.RemoveProjectDirectory(strings, NativeMethodsShared.IsWindows ? "c:\\directory" : "/directory").ToArray(); 1464Assert.Equal(strings[0], NativeMethodsShared.IsWindows ? "c:\\directorymorechars\\1.file" : "/directorymorechars/1.file"); 1466if (NativeMethodsShared.IsWindows)
FileUtilities_Tests.cs (13)
51string itemSpec = NativeMethodsShared.IsWindows ? @"c:\foo.txt" : "/foo.txt"; 52string itemSpecDir = NativeMethodsShared.IsWindows ? @"c:\" : "/"; 72string projectPath = NativeMethodsShared.IsWindows ? @"c:\abc\goo.proj" : @"/abc/goo.proj"; 73string projectPathDir = NativeMethodsShared.IsWindows ? @"c:\abc\" : @"/abc/"; 90if (NativeMethodsShared.IsWindows) 246Assert.Equal(NativeMethodsShared.IsWindows ? @"c:\" : "/", FileUtilities.GetDirectory(NativeMethodsShared.IsWindows ? @"c:\" : "/")); 247Assert.Equal(NativeMethodsShared.IsWindows ? @"c:\" : "/", FileUtilities.GetDirectory(NativeMethodsShared.IsWindows ? @"c:\foo" : "/foo")); 248Assert.Equal(NativeMethodsShared.IsWindows ? @"c:" : "/", FileUtilities.GetDirectory(NativeMethodsShared.IsWindows ? @"c:" : "/")); 550var isWindows = NativeMethodsShared.IsWindows; 965string root = NativeMethodsShared.IsWindows ? @"c:\" : "/";
Globbing\MSBuildGlob_Tests.cs (5)
39var globRoot = NativeMethodsShared.IsWindows ? @"c:\a" : "/a"; 112var globRoot = NativeMethodsShared.IsWindows ? @"c:\a" : "/a"; 133var globRoot = NativeMethodsShared.IsWindows ? @"c:\a" : "/a"; 153var globRoot = NativeMethodsShared.IsWindows ? @"c:\a" : "/a"; 353return NativeMethodsShared.IsWindows ? normalizedPath.Replace("\\\\", "\\") : normalizedPath;
Microsoft.Build.Framework (18)
EncodingUtilities.cs (2)
57if (NativeMethods.IsWindows) 223if (!NativeMethods.IsWindows)
NativeMethods.cs (16)
447if (IsWindows) 496if (IsWindows) 601return IsWindows && !IsLongPathsEnabledRegistry(); 708get { return IsWindows ? "Windows_NT" : "Unix"; } 860if (IsWindows) 900if (!IsWindows) 977if (IsWindows) 995if (IsWindows) 1059if (IsWindows) 1375if (IsWindows) 1459if (IsWindows) 1506if (IsWindows && originalConsoleMode is not null) 1590if (IsWindows) 1697return IsWindows 1712return IsWindows 1727return IsWindows
Microsoft.Build.Framework.UnitTests (3)
FileClassifier_Tests.cs (3)
26var volume = NativeMethodsShared.IsWindows ? @"X:\" : "/home/usr"; 40var volume = NativeMethodsShared.IsWindows ? @"X:\" : "/home/usr"; 58var volume = NativeMethodsShared.IsWindows ? @"X:\" : "/home/usr";
Microsoft.Build.Tasks.Core (53)
AssemblyDependency\AssemblyInformation.cs (6)
78if (NativeMethodsShared.IsWindows) 246if (!NativeMethodsShared.IsWindows) 384if (!NativeMethodsShared.IsWindows) 637if (NativeMethodsShared.IsWindows) 660if (NativeMethodsShared.IsWindows) 711if (!NativeMethodsShared.IsWindows)
AssemblyDependency\AssemblyMetadata.cs (1)
30ScatterFiles = NativeMethodsShared.IsWindows ? import.Files : null;
AssemblyDependency\GlobalAssemblyCache.cs (1)
185if (NativeMethodsShared.IsWindows)
AssemblyDependency\Reference.cs (1)
514else if (NativeMethodsShared.IsWindows)
AssemblyFolder.cs (1)
108if (NativeMethodsShared.IsWindows)
AssemblyFoldersEx.cs (1)
80if (!NativeMethodsShared.IsWindows)
BuildEnvironmentHelper.cs (3)
139if (!NativeMethodsShared.IsWindows) 171if (NativeMethodsShared.IsWindows && 244if (NativeMethodsShared.IsWindows &&
Copy.cs (2)
326if (!NativeMethodsShared.IsWindows) 1028if (NativeMethodsShared.IsWindows)
Exec.cs (3)
493if (NativeMethodsShared.IsWindows) 585if (NativeMethodsShared.IsWindows) 646protected override string ToolName => NativeMethodsShared.IsWindows ? "cmd.exe" : "sh";
FileMatcher.cs (2)
1259bool isUncPath = NativeMethodsShared.IsWindows && fixedDir.Length > 1 2255if (NativeMethodsShared.IsWindows &&
FileState.cs (3)
90if (NativeMethodsShared.IsWindows) 103if (NativeMethodsShared.IsWindows) 177if (NativeMethodsShared.IsWindows)
FileSystems.cs (1)
20if (NativeMethodsShared.IsWindows)
FileUtilities.cs (6)
484if (NativeMethodsShared.IsWindows) 509if (!NativeMethodsShared.IsWindows || !path.StartsWith(@"\\", StringComparison.Ordinal)) 564if (NativeMethodsShared.IsWindows || string.IsNullOrEmpty(value) 585if (NativeMethodsShared.IsWindows || value.IsEmpty) 670if (NativeMethodsShared.IsWindows) 764if (NativeMethodsShared.IsWindows && !EndsWithSlash(fullPath))
GenerateApplicationManifest.cs (1)
115if (!NativeMethodsShared.IsWindows)
GenerateDeploymentManifest.cs (1)
157if (!NativeMethodsShared.IsWindows)
GenerateLauncher.cs (1)
44if (!NativeMethodsShared.IsWindows)
GenerateManifestBase.cs (2)
275if (!NativeMethodsShared.IsWindows) 623if (NativeMethodsShared.IsWindows)
GenerateResource.cs (1)
932private static readonly bool AllowMOTW = !NativeMethodsShared.IsWindows || (Registry.GetValue(@"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework\SDK", "AllowProcessOfUntrustedResourceFiles", null) is string allowUntrustedFiles && allowUntrustedFiles.Equals("true", StringComparison.OrdinalIgnoreCase));
GetInstalledSDKLocations.cs (1)
127if (!NativeMethodsShared.IsWindows)
GetSDKReferenceFiles.cs (1)
230if (!NativeMethodsShared.IsWindows)
ManagedFileSystem.cs (1)
26return NativeMethodsShared.IsWindows;
ManifestUtil\SecurityUtil.cs (1)
868if (NativeMethodsShared.IsWindows && (toolPath == null || !FileSystems.Default.FileExists(toolPath)))
Modifiers.cs (1)
464if (NativeMethodsShared.IsWindows)
NativeMethods.cs (5)
805if (NativeMethodsShared.IsWindows) 838if (NativeMethodsShared.IsWindows) 989if (NativeMethodsShared.IsWindows) 1284if (NativeMethodsShared.IsWindows) 1344if (NativeMethodsShared.IsWindows)
ResGen.cs (2)
334&& NativeMethodsShared.IsWindows 374NativeMethodsShared.IsWindows &&
ResolveSDKReference.cs (1)
268if (!NativeMethodsShared.IsWindows)
SignFile.cs (1)
46if (!NativeMethodsShared.IsWindows)
TempFileUtilities.cs (1)
42string msbuildTempFolder = NativeMethodsShared.IsWindows ?
XamlTaskFactory\TaskParser.cs (1)
174if (NativeMethodsShared.IsWindows)
Microsoft.Build.Tasks.UnitTests (69)
AssemblyDependency\ResolveAssemblyReferenceTestFixture.cs (1)
190protected static readonly string s_rootPathPrefix = NativeMethodsShared.IsWindows ? "C:\\" : Path.VolumeSeparatorChar.ToString();
AssignTargetPath_Tests.cs (12)
24{ new TaskItem(NativeMethodsShared.IsWindows ? @"c:\bin2\abc.efg" : "/bin2/abc.efg") }; 25t.RootFolder = NativeMethodsShared.IsWindows ? @"c:\bin" : "/bin"; 29t.AssignedFiles[0].ItemSpec.ShouldBe(NativeMethodsShared.IsWindows ? @"c:\bin2\abc.efg" : "/bin2/abc.efg"); 39{ new TaskItem(NativeMethodsShared.IsWindows ? @"c:\f1\f2\file.txt" : "/f1/f2/file.txt") }; 40t.RootFolder = NativeMethodsShared.IsWindows ? @"c:\f1\f2" : "/f1/f2"; 55NativeMethodsShared.IsWindows ? @"d:\f1\f2\f3\f4\file.txt" : "/f1/f2/f3/f4/file.txt") 61t.RootFolder = NativeMethodsShared.IsWindows ? @"c:\f1" : "/x1"; 76NativeMethodsShared.IsWindows ? @"c:\f1\f2\f3\f4\file.txt" : "/f1/f2/f3/f4/file.txt") 78t.RootFolder = NativeMethodsShared.IsWindows ? @"c:\f1\f2" : "/f1/f2"; 82t.AssignedFiles[0].GetMetadata("TargetPath").ShouldBe(NativeMethodsShared.IsWindows ? @"f3\f4\file.txt" : "f3/f4/file.txt"); 101itemSpec: NativeMethodsShared.IsWindows ? @"c:\f1\f2\file.txt" : "/f1/f2/file.txt", 104t.RootFolder = NativeMethodsShared.IsWindows ? @"c:\f1\f2" : "/f1/f2";
CodeTaskFactoryEmbeddedFileInBinlogTestHelper.cs (2)
72projectDirectoryPath = NativeMethodsShared.IsWindows ? projectDirectoryPath.Replace(":\\", "\\") : projectDirectoryPath.Replace("/", "\\"); 124projectDirectory = NativeMethodsShared.IsWindows ? projectDirectory.Replace(":\\", "\\") : projectDirectory.Replace("/", "\\");
CombinePath_Tests.cs (11)
49string path1 = NativeMethodsShared.IsWindows ? @"c:\ghi.txt" : "/ghi.txt"; 50string path2 = NativeMethodsShared.IsWindows ? @"d:\jkl\mno.txt" : "/jkl/mno.txt"; 52string pathsToMatch = string.Format(NativeMethodsShared.IsWindows ? @" 61t.Paths = NativeMethodsShared.IsWindows 78t.BasePath = NativeMethodsShared.IsWindows ? @"c:\abc\def" : "/abc/def"; 98t.BasePath = NativeMethodsShared.IsWindows ? @"\\fileserver\public" : "/rootdir/public"; 99string path1 = NativeMethodsShared.IsWindows ? @"c:\ghi.txt" : "/ghi.txt"; 100string path2 = NativeMethodsShared.IsWindows ? @"d:\jkl\mno.txt" : "/jkl/mno.txt"; 102string pathsToMatch = string.Format(NativeMethodsShared.IsWindows ? @" 110t.Paths = NativeMethodsShared.IsWindows 128if (NativeMethodsShared.IsWindows)
Copy_Tests.cs (1)
1384if (NativeMethodsShared.IsWindows)
Exec_Tests.cs (22)
148Exec exec = PrepareExec(NativeMethodsShared.IsWindows ? "xcopy thisisanonexistentfile" : "cp thisisanonexistentfile thatisanonexistentfile"); 152Assert.Equal(NativeMethodsShared.IsWindows ? 4 : 1, exec.ExitCode); 154if (!NativeMethodsShared.IsWindows) 164int expectedExitCode = NativeMethodsShared.IsWindows ? -1 : 137; 166Exec exec = PrepareExec(NativeMethodsShared.IsWindows ? ":foo \n goto foo" : "while true; do sleep 1; done"); 185Exec exec = PrepareExec(NativeMethodsShared.IsWindows ? ":foo \n goto foo" : "while true; do sleep 1; done"); 199exec.ExitCode.ShouldBe(NativeMethodsShared.IsWindows ? -1 : 137); 228var cmdLine = NativeMethodsShared.IsWindows 245var cmdLine = NativeMethodsShared.IsWindows 269Exec exec = PrepareExec(NativeMethodsShared.IsWindows ? "echo [%cd%]" : "echo [$PWD]"); 270string working = !NativeMethodsShared.IsWindows ? "/usr/lib" : 302Directory.SetCurrentDirectory(NativeMethodsShared.IsWindows ? 305Exec exec = PrepareExec(NativeMethodsShared.IsWindows ? "echo [%cd%]" : "echo [$PWD]"); 579if (!NativeMethodsShared.IsWindows) 640if (NativeMethodsShared.IsWindows) 663if (NativeMethodsShared.IsWindows) 694if (NativeMethodsShared.IsWindows) 726var cmdLine = NativeMethodsShared.IsWindows 742var cmdLine = NativeMethodsShared.IsWindows 792var cmdLine = NativeMethodsShared.IsWindows 888exec.Command = NativeMethodsShared.IsWindows ? "echo [%MYENVVAR%]" : "echo [$myenvvar]"; 1041Exec exec = PrepareExec(NativeMethodsShared.IsWindows ? $"type {textFilePath}" : $"cat {textFilePath}");
FindUnderPath_Tests.cs (3)
79new TaskItem(NativeMethodsShared.IsWindows ? @"C:\SomeoneElsesProject\File2.txt" : "/SomeoneElsesProject/File2.txt") }; 112Assert.Equal(NativeMethodsShared.IsWindows ? @"C:\SomeoneElsesProject\File2.txt" : "/SomeoneElsesProject/File2.txt", 134Assert.Equal(NativeMethodsShared.IsWindows ? @"C:\SomeoneElsesProject\File2.txt" : "/SomeoneElsesProject/File2.txt",
MakeDir_Tests.cs (2)
91if (NativeMethodsShared.IsWindows) 115if (!NativeMethodsShared.IsWindows)
ResolveSDKReference_Tests.cs (2)
26private readonly string _sdkPath = NativeMethodsShared.IsWindows 1520string goodSDKLocation = NativeMethodsShared.IsWindows ? "C:\\GoodSDKLocation\\" : "/GoodSDKLocation/";
ResourceHandling\GenerateResource_Tests.cs (7)
433NativeMethodsShared.IsWindows ? bitmap.ToUpper() : bitmap, 652NativeMethodsShared.IsWindows ? bitmap.ToUpper() : bitmap); 698if (!NativeMethodsShared.IsWindows) 908if (!NativeMethodsShared.IsWindows) 2840t.StronglyTypedFileName = NativeMethodsShared.IsWindows ? "||" : "\0"; 4076NativeMethodsShared.IsWindows 4166NativeMethodsShared.IsWindows ? smallestBitmapFile.ToUpperInvariant() : smallestBitmapFile,
Touch_Tests.cs (4)
26internal static string myexisting_txt = NativeMethodsShared.IsWindows ? @"c:\touch\myexisting.txt" : @"/touch/myexisting.txt"; 27internal static string mynonexisting_txt = NativeMethodsShared.IsWindows ? @"c:\touch\mynonexisting.txt" : @"/touch/mynonexisting.txt"; 28internal static string nonexisting_txt = NativeMethodsShared.IsWindows ? @"c:\touch-nonexistent\file.txt" : @"/touch-nonexistent/file.txt"; 29internal static string myreadonly_txt = NativeMethodsShared.IsWindows ? @"c:\touch\myreadonly.txt" : @"/touch/myreadonly.txt";
Unzip_Tests.cs (1)
156if (NativeMethodsShared.IsWindows)
WriteCodeFragment_Tests.cs (1)
542public static string EscapedLineSeparator => NativeMethodsShared.IsWindows ? "\\r\\n" : "\\n";
Microsoft.Build.UnitTests.Shared (7)
DummyMappedDrive.cs (2)
25if (!NativeMethodsShared.IsWindows) 61if (_mapped && NativeMethodsShared.IsWindows)
DummyMappedDriveUtils.cs (1)
26return NativeMethods.IsWindows ? new DummyMappedDrive() : default;
ObjectModelHelpers.cs (2)
1987NativeMethodsShared.IsWindows 1998NativeMethodsShared.IsWindows
RequiresSymbolicLinksFactAttribute.cs (1)
22if (s_runningInAzurePipeline || !NativeMethodsShared.IsWindows)
RunnerUtilities.cs (1)
78if (NativeMethodsShared.IsWindows)
Microsoft.Build.Utilities.Core (41)
AssemblyFoldersEx.cs (1)
80if (!NativeMethodsShared.IsWindows)
BuildEnvironmentHelper.cs (3)
139if (!NativeMethodsShared.IsWindows) 171if (NativeMethodsShared.IsWindows && 244if (NativeMethodsShared.IsWindows &&
FileMatcher.cs (2)
1259bool isUncPath = NativeMethodsShared.IsWindows && fixedDir.Length > 1 2255if (NativeMethodsShared.IsWindows &&
FileSystems.cs (1)
20if (NativeMethodsShared.IsWindows)
FileUtilities.cs (6)
484if (NativeMethodsShared.IsWindows) 509if (!NativeMethodsShared.IsWindows || !path.StartsWith(@"\\", StringComparison.Ordinal)) 564if (NativeMethodsShared.IsWindows || string.IsNullOrEmpty(value) 585if (NativeMethodsShared.IsWindows || value.IsEmpty) 670if (NativeMethodsShared.IsWindows) 764if (NativeMethodsShared.IsWindows && !EndsWithSlash(fullPath))
FrameworkLocationHelper.cs (16)
90internal static string dotNetFrameworkVersionFolderPrefixV11 = NativeMethodsShared.IsWindows ? "v1.1" : "1.1"; // v1.1 is for Everett. 95internal static string dotNetFrameworkVersionFolderPrefixV20 = NativeMethodsShared.IsWindows ? "v2.0" : "2.0"; // v2.0 is for Whidbey. 99internal static string dotNetFrameworkVersionFolderPrefixV30 = NativeMethodsShared.IsWindows ? "v3.0" : "3.0"; // v3.0 is for WinFx. 113internal static string dotNetFrameworkVersionFolderPrefixV35 = NativeMethodsShared.IsWindows ? "v3.5" : "3.5"; // v3.5 is for Orcas. 119internal static string dotNetFrameworkVersionFolderPrefixV40 = NativeMethodsShared.IsWindows ? "v4.0" : "4.0"; 120internal static string dotNetFrameworkVersionFolderPrefixV45 = NativeMethodsShared.IsWindows ? "v4.5" : "4.5"; 503if (!NativeMethodsShared.IsWindows) 553if (NativeMethodsShared.IsWindows) 600if (NativeMethodsShared.IsWindows) 741if (NativeMethodsShared.IsWindows) 774if (!NativeMethodsShared.IsWindows) 928combinedPath = NativeMethodsShared.IsWindows 1142dotNetFrameworkVersionFolderPrefix: NativeMethodsShared.IsWindows ? "v4.0" : "v4.5", 1373if (NativeMethodsShared.IsWindows && !CheckForFrameworkInstallation( 1395(!FileSystems.Default.FileExists(Path.Combine(generatedPathToDotNetFramework, NativeMethodsShared.IsWindows ? "MSBuild.exe" : "mcs.exe")) && 1514if (NativeMethodsShared.IsWindows)
ManagedFileSystem.cs (1)
26return NativeMethodsShared.IsWindows;
Modifiers.cs (1)
464if (NativeMethodsShared.IsWindows)
ProcessExtensions.cs (1)
17if (NativeMethodsShared.IsWindows)
TempFileUtilities.cs (1)
42string msbuildTempFolder = NativeMethodsShared.IsWindows ?
ToolLocationHelper.cs (4)
1821if (NativeMethodsShared.IsWindows && platformTarget != null) 2438string registryRoot = NativeMethodsShared.IsWindows ? GetTargetPlatformMonikerRegistryRoots(registrySearchLocation) : string.Empty; 2463if (NativeMethodsShared.IsWindows && ChangeWaves.AreFeaturesEnabled(ChangeWaves.Wave17_4)) 2889if (NativeMethodsShared.IsWindows)
ToolTask.cs (4)
655if (NativeMethodsShared.IsWindows) 767if (NativeMethodsShared.IsWindows) 1400bool runningOnWindows = NativeMethodsShared.IsWindows; 1632if (NativeMethodsShared.IsWindows)
Microsoft.Build.Utilities.UnitTests (40)
ProcessExtensions_Tests.cs (1)
20NativeMethodsShared.IsWindows ?
TaskItem_Tests.cs (2)
227from.ItemSpec = NativeMethodsShared.IsWindows ? @"c:\subdir\Monkey.txt" : "/subdir/Monkey.txt"; 228from.GetMetadata(FileUtilities.ItemSpecModifiers.Directory).ShouldBe(NativeMethodsShared.IsWindows ? @"subdir\" : "subdir/");
ToolLocationHelper_Tests.cs (11)
376NativeMethodsShared.IsWindows ? "f:\\IDontExistAtAll" : "/IDontExistAtAll"); 388NativeMethodsShared.IsWindows ? "f:\\IDontExistAtAll" : "/IDontExistAtAll", 1264string targetFrameworkRootPath = NativeMethodsShared.IsWindows 1285string targetFrameworkRootPath = NativeMethodsShared.IsWindows 1307string targetFrameworkRootPath = NativeMethodsShared.IsWindows 1328string targetFrameworkRootPath = NativeMethodsShared.IsWindows 1351string targetFrameworkRootPath = NativeMethodsShared.IsWindows 3075string tooLongPath = NativeMethodsShared.IsWindows 3110string normalDirectory = NativeMethodsShared.IsWindows ? "c:\\SDKPath" : "/SDKPath"; 3131string frameworkPathPattern = NativeMethodsShared.IsWindows ? @"Microsoft SDKs\Windows\v8.0\ExtensionSDKs\MyFramework" : "Microsoft SDKs/Windows/v8.0/ExtensionSDKs/MyFramework"; 3132string frameworkPathPattern2 = NativeMethodsShared.IsWindows ? @"ExtensionSDKs\MyFramework" : "ExtensionSDKs/MyFramework";
ToolTask_Tests.cs (26)
111if (!NativeMethodsShared.IsWindows && string.IsNullOrEmpty(responseFileCommands) && string.IsNullOrEmpty(commandLineCommands)) 118StartInfo = GetProcessStartInfo(GenerateFullPathToTool(), NativeMethodsShared.IsWindows ? "/x" : string.Empty, null); 130t.ToolPath = NativeMethodsShared.IsWindows ? @"C:\MyAlternatePath" : "/MyAlternatePath"; 146t.ToolPath = NativeMethodsShared.IsWindows ? @"C:\MyAlternatePath" : "/MyAlternatePath"; 166t.FullToolName = Path.Combine(systemPath, NativeMethodsShared.IsWindows ? "attrib.exe" : "ps"); 188t.MockCommandLineCommands = NativeMethodsShared.IsWindows ? "/C garbagegarbagegarbagegarbage.exe" : "-c garbagegarbagegarbagegarbage.exe"; 191t.ExitCode.ShouldBe(NativeMethodsShared.IsWindows ? 1 : 127); // cmd.exe error code is 1, sh error code is 127 213t.MockCommandLineCommands = NativeMethodsShared.IsWindows 240t.MockCommandLineCommands = NativeMethodsShared.IsWindows 272string singleQuote = NativeMethodsShared.IsWindows ? "'" : string.Empty; 289t.MockCommandLineCommands = NativeMethodsShared.IsWindows 313t.MockCommandLineCommands = NativeMethodsShared.IsWindows 337t.MockCommandLineCommands = NativeMethodsShared.IsWindows 361t.FullToolName = NativeMethodsShared.IsWindows ? "c:\\baz\\foo.exe" : "/baz/foo.exe"; 376string shellName = NativeMethodsShared.IsWindows ? "cmd.exe" : "sh"; 377string copyName = NativeMethodsShared.IsWindows ? "xcopy.exe" : "cp"; 429string toolName = NativeMethodsShared.IsWindows ? "cmd.exe" : "sh"; 457t.FullToolName = NativeMethodsShared.IsWindows ? "findstr.exe" : "grep"; 485t.FullToolName = NativeMethodsShared.IsWindows ? "findstr.exe" : "grep"; 519t.MockCommandLineCommands = NativeMethodsShared.IsWindows 546string userVarName = NativeMethodsShared.IsWindows ? "username" : "user"; 560if (NativeMethodsShared.IsWindows) 652string toolName = NativeMethodsShared.IsWindows ? "cmd" : "sh"; 693if (NativeMethodsShared.IsWindows) 732t.MockCommandLineCommands = NativeMethodsShared.IsWindows 764t.MockCommandLineCommands = NativeMethodsShared.IsWindows
MSBuild (14)
BuildEnvironmentHelper.cs (3)
139if (!NativeMethodsShared.IsWindows) 171if (NativeMethodsShared.IsWindows && 244if (NativeMethodsShared.IsWindows &&
CommunicationsUtilities.cs (1)
517if (!NativeMethodsShared.IsWindows)
FileSystems.cs (1)
20if (NativeMethodsShared.IsWindows)
FileUtilities.cs (4)
564if (NativeMethodsShared.IsWindows || string.IsNullOrEmpty(value) 585if (NativeMethodsShared.IsWindows || value.IsEmpty) 670if (NativeMethodsShared.IsWindows) 764if (NativeMethodsShared.IsWindows && !EndsWithSlash(fullPath))
ManagedFileSystem.cs (1)
26return NativeMethodsShared.IsWindows;
Modifiers.cs (1)
464if (NativeMethodsShared.IsWindows)
MSBuildClientApp.cs (1)
109NativeMethodsShared.IsWindows ? "dotnet.exe" : "dotnet");
TempFileUtilities.cs (1)
42string msbuildTempFolder = NativeMethodsShared.IsWindows ?
XMake.cs (1)
1846if (NativeMethodsShared.IsWindows &&