Fix some items detected by a scanning tool.

---------

Co-authored-by: Marc Paine <marcpop@microsoft.com>
This commit is contained in:
Rainer Sigwald 2023-05-25 11:07:53 -05:00 коммит произвёл GitHub
Родитель 7d65cb31cd
Коммит 2a2ac62f54
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
42 изменённых файлов: 365 добавлений и 365 удалений

Просмотреть файл

@ -29,7 +29,7 @@ EventSource is primarily used to profile code. For MSBuild specifically, a major
| RarComputeClosure | Resolves references from, for example, properties to explicit values. Used in resolving assembly references (RAR). |
| RarLogResults | Logs the results from having resolved assembly references (RAR). |
| RarOverall | Initiates the process of resolving assembly references (RAR). |
| RarRemoveReferencesMarkedForExclusion | Removes blacklisted references from the reference table, putting primary and dependency references in invalid file lists. |
| RarRemoveReferencesMarkedForExclusion | Removes denylisted references from the reference table, putting primary and dependency references in invalid file lists. |
| RequestThreadProc | A function to requesting a new builder thread. |
| ReusableStringBuilderFactory | Uses and resizes (if necessary) of ReusableStringBuilders. |
| ReusableStringBuilderFactoryUnbalanced | Identifies improper usage from multiple threads or buggy code: multiple Gets were called without a Relase. |

Просмотреть файл

@ -1068,7 +1068,7 @@ namespace Microsoft.Build.UnitTests.Logging
public void ImportanceReflectsUnknownLoggerVerbosity()
{
// Minimum message importance is Low (i.e. we're logging everything) even when all registered loggers have
// Normal verbosity if at least of one them is not on our whitelist.
// Normal verbosity if at least of one them is not on our allowlist.
_initializedService.RegisterLogger(new ConsoleLogger(LoggerVerbosity.Normal));
_initializedService.RegisterLogger(new MockLogger() { Verbosity = LoggerVerbosity.Normal });
_initializedService.RegisterLogger(CreateConfigurableForwardingLogger(LoggerVerbosity.Normal));

Просмотреть файл

@ -868,15 +868,15 @@ namespace Microsoft.Build.UnitTests.EscapingInProjects_Tests
<MyUserMacro>foo%3bbar</MyUserMacro>
</PropertyGroup>
<ItemGroup>
<CrazyList Include=""a"" />
<CrazyList Include=""b%3bc"" />
<CrazyList Include=""$(MyUserMacro)"" />
<DifferentList Include=""a"" />
<DifferentList Include=""b%3bc"" />
<DifferentList Include=""$(MyUserMacro)"" />
</ItemGroup>
</Project>";
System.Xml.XmlReader reader = new System.Xml.XmlTextReader(new StringReader(projectString));
Project project = new Project(reader);
IEnumerable<ProjectItem> items = project.GetItems("CrazyList");
IEnumerable<ProjectItem> items = project.GetItems("DifferentList");
Assert.Equal(3, items.Count());
Assert.Equal("a", items.ElementAt(0).EvaluatedInclude);
@ -900,15 +900,15 @@ namespace Microsoft.Build.UnitTests.EscapingInProjects_Tests
<MyUserMacro>foo;bar</MyUserMacro>
</PropertyGroup>
<ItemGroup>
<CrazyList Include=""a"" />
<CrazyList Include=""b%3bc"" />
<CrazyList Include=""$(MyUserMacro)"" />
<DifferentList Include=""a"" />
<DifferentList Include=""b%3bc"" />
<DifferentList Include=""$(MyUserMacro)"" />
</ItemGroup>
</Project>";
System.Xml.XmlReader reader = new System.Xml.XmlTextReader(new StringReader(projectString));
Project project = new Project(reader);
IEnumerable<ProjectItem> items = project.GetItems("CrazyList");
IEnumerable<ProjectItem> items = project.GetItems("DifferentList");
Assert.Equal(4, items.Count());
Assert.Equal("a", items.ElementAt(0).EvaluatedInclude);
@ -1446,11 +1446,11 @@ namespace Microsoft.Build.UnitTests.EscapingInProjects_Tests
/// <summary>
/// Build a .SLN file using MSBuild. The .SLN and the projects contained within
/// have all sorts of crazy characters in their name. There
/// have all sorts of different characters in their name. There
/// is even a P2P reference between the two projects in the .SLN.
/// </summary>
[Fact(Skip = "This is a known issue in Roslyn. This test should be enabled if Roslyn is updated for this scenario.")]
public void SolutionWithLotsaCrazyCharacters()
public void SolutionWithLotsaDifferentCharacters()
{
ObjectModelHelpers.DeleteTempProjectDirectory();
@ -1612,11 +1612,11 @@ namespace Microsoft.Build.UnitTests.EscapingInProjects_Tests
/// <summary>
/// Build a .SLN file using MSBuild. The .SLN and the projects contained within
/// have all sorts of crazy characters in their name. There
/// have all sorts of different characters in their name. There
/// is even a P2P reference between the two projects in the .SLN.
/// </summary>
[Fact(Skip = "This is a known issue in Roslyn. This test should be enabled if Roslyn is updated for this scenario.")]
public void SolutionWithLotsaCrazyCharacters_UsingTaskHost()
public void SolutionWithLotsaDifferentCharacters_UsingTaskHost()
{
string originalOverrideTaskHostVariable = Environment.GetEnvironmentVariable("MSBUILDFORCEALLTASKSOUTOFPROC");

Просмотреть файл

@ -3180,17 +3180,17 @@ namespace Microsoft.Build.UnitTests.Evaluation
{
PropertyDictionary<ProjectPropertyInstance> pg = new PropertyDictionary<ProjectPropertyInstance>();
pg["BonkersTargetsPath"] = ProjectPropertyInstance.Create("BonkersTargetsPath", "Bonkers");
pg["DifferentTargetsPath"] = ProjectPropertyInstance.Create("DifferentTargetsPath", "Different");
Expander<ProjectPropertyInstance, ProjectItemInstance> expander = new Expander<ProjectPropertyInstance, ProjectItemInstance>(pg, FileSystems.Default);
string result = expander.ExpandIntoStringLeaveEscaped(@"$([MSBuild]::ValueOrDefault('$(BonkersTargetsPath)', '42'))", ExpanderOptions.ExpandProperties, MockElementLocation.Instance);
string result = expander.ExpandIntoStringLeaveEscaped(@"$([MSBuild]::ValueOrDefault('$(DifferentTargetsPath)', '42'))", ExpanderOptions.ExpandProperties, MockElementLocation.Instance);
Assert.Equal("Bonkers", result);
Assert.Equal("Different", result);
pg["BonkersTargetsPath"] = ProjectPropertyInstance.Create("BonkersTargetsPath", String.Empty);
pg["DifferentTargetsPath"] = ProjectPropertyInstance.Create("DifferentTargetsPath", String.Empty);
result = expander.ExpandIntoStringLeaveEscaped(@"$([MSBuild]::ValueOrDefault('$(BonkersTargetsPath)', '43'))", ExpanderOptions.ExpandProperties, MockElementLocation.Instance);
result = expander.ExpandIntoStringLeaveEscaped(@"$([MSBuild]::ValueOrDefault('$(DifferentTargetsPath)', '43'))", ExpanderOptions.ExpandProperties, MockElementLocation.Instance);
Assert.Equal("43", result);
}

Просмотреть файл

@ -898,10 +898,10 @@ namespace Microsoft.Build.UnitTests
}
/// <summary>
/// Synthesizes Link metadata if the items are defined in an import and are on the whitelist
/// Synthesizes Link metadata if the items are defined in an import and are on the allowlist
/// </summary>
[Fact]
public void SynthesizeLinkMetadataForItemsOnWhitelist()
public void SynthesizeLinkMetadataForItemsOnAllowlist()
{
string outputPath = Path.Combine(Path.GetTempPath(), Guid.NewGuid().ToString("N"));
string directoryToDelete = null;

Просмотреть файл

@ -4707,7 +4707,7 @@ namespace Microsoft.Build.Evaluation
return null;
}
// Check if the type is in the whitelist cache. If it is, use it or load it.
// Check if the type is in the allowlist cache. If it is, use it or load it.
cachedTypeInformation = AvailableStaticMethods.GetTypeInformationFromTypeCache(typeName, simpleMethodName);
if (cachedTypeInformation != null)
{
@ -4730,7 +4730,7 @@ namespace Microsoft.Build.Evaluation
// If the type information from the cache is not loadable, it means the cache information got corrupted somehow
// Throw here to prevent adding null types in the cache
ErrorUtilities.VerifyThrowInternalNull(receiverType, $"Type information for {typeName} was present in the whitelist cache as {assemblyQualifiedTypeName} but the type could not be loaded.");
ErrorUtilities.VerifyThrowInternalNull(receiverType, $"Type information for {typeName} was present in the allowlist cache as {assemblyQualifiedTypeName} but the type could not be loaded.");
// If we've used it once, chances are that we'll be using it again
// We can record the type here since we know it's available for calling from the fact that is was in the AvailableStaticMethods table
@ -4748,7 +4748,7 @@ namespace Microsoft.Build.Evaluation
// DO NOT CACHE THE TYPE HERE!
// We don't add the resolved type here in the AvailableStaticMethods table. This is because that table is used
// during function parse, but only later during execution do we check for the ability to call specific methods on specific types.
// Caching it here would load any type into the white list.
// Caching it here would load any type into the allow list.
return receiverType;
}
@ -5151,7 +5151,7 @@ namespace Microsoft.Build.Evaluation
}
/// <summary>
/// Check the property function whitelist whether this method is available.
/// Check the property function allowlist whether this method is available.
/// </summary>
private static bool IsStaticMethodAvailable(Type receiverType, string methodName)
{

Просмотреть файл

@ -1860,9 +1860,9 @@ namespace Microsoft.Build.UnitTests
HintPath = `D:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\System.XML.dll`
/>
<Reference
Name = `Microsoft.My'Crazy;Assemb%ly`
AssemblyName = `Microsoft.My'Crazy;Assemb%ly`
HintPath = `D:\myapps\Microsoft.My'Crazy;Assemb%ly.dll`
Name = `Microsoft.My'Different;Assemb%ly`
AssemblyName = `Microsoft.My'Different;Assemb%ly`
HintPath = `D:\myapps\Microsoft.My'Different;Assemb%ly.dll`
/>
</References>
</Build>
@ -1954,9 +1954,9 @@ namespace Microsoft.Build.UnitTests
<ErrorReport>prompt</ErrorReport>
</PropertyGroup>
<ItemGroup>
<Reference Include=`Microsoft.My%27Crazy%3bAssemb%25ly`>
<Name>Microsoft.My%27Crazy%3bAssemb%25ly</Name>
<HintPath>D:\myapps\Microsoft.My%27Crazy%3bAssemb%25ly.dll</HintPath>
<Reference Include=`Microsoft.My%27Different%3bAssemb%25ly`>
<Name>Microsoft.My%27Different%3bAssemb%25ly</Name>
<HintPath>D:\myapps\Microsoft.My%27Different%3bAssemb%25ly.dll</HintPath>
</Reference>
<Reference Include=`System`>
<Name>System</Name>

Просмотреть файл

@ -332,7 +332,7 @@ namespace Microsoft.Build.UnitTests.OM.OrcasCompatibility
InvokeAddNewImportMethod(p, projectPath, "true");
Assertion.AssertEquals(0, p.Imports.Count);
object o = p.EvaluatedItems; // force evaluation of imported projects.
Assertion.AssertEquals(0, p.Imports.Count); // This is bonkers, should be 1 because the XML DOES contain the import node.
Assertion.AssertEquals(0, p.Imports.Count); // Should be 1 because the XML DOES contain the import node.
}
finally
{

Просмотреть файл

@ -150,7 +150,7 @@ namespace Microsoft.Build.UnitTests.OM.OrcasCompatibility
/// <summary>
/// Test Data Item
/// </summary>
internal const string ContentSimpleInvalidEncoding = @"<?xml version='1.0' encoding='crazy'?>
internal const string ContentSimpleInvalidEncoding = @"<?xml version='1.0' encoding='different'?>
<Project ToolsVersion='4.0' xmlns='http://schemas.microsoft.com/developer/msbuild/2003'>
<Target Name='TestTarget'>
<Message Text='Executed TestTarget'/>

Просмотреть файл

@ -213,8 +213,8 @@ namespace Microsoft.Build.UnitTests
engine.RegisterLogger(myLogger);
// Create a custom build event args that derives from MSBuild's BuildErrorEventArgs.
// Set a custom field on this event (FXCopRule).
MyCustomBuildErrorEventArgs fxcopError = new MyCustomBuildErrorEventArgs("Your code is lame.");
fxcopError.FXCopRule = "CodeLamenessViolation";
MyCustomBuildErrorEventArgs fxcopError = new MyCustomBuildErrorEventArgs("Your code is bad.");
fxcopError.FXCopRule = "CodeBadnessViolation";
// Log the custom event args. (Pretend that the task actually did this.)
engineProxy.LogErrorEvent(fxcopError);
@ -225,8 +225,8 @@ namespace Microsoft.Build.UnitTests
// Make sure the special fields in the custom event match what we originally logged.
fxcopError = myLogger.lastError as MyCustomBuildErrorEventArgs;
Assertion.AssertEquals("Your code is lame.", fxcopError.Message);
Assertion.AssertEquals("CodeLamenessViolation", fxcopError.FXCopRule);
Assertion.AssertEquals("Your code is bad.", fxcopError.Message);
Assertion.AssertEquals("CodeBadnessViolation", fxcopError.FXCopRule);
}
/// <summary>
@ -400,7 +400,7 @@ namespace Microsoft.Build.UnitTests
</Target>
</Project>
");
Assertion.AssertEquals("Expected zero errors", 0, logger.ErrorCount);
@ -426,8 +426,8 @@ namespace Microsoft.Build.UnitTests
// Verify TEM is running singleProc mode before we can test to make sure EngineProxy is correctly using the value
Assertion.Assert("Expected TEM to be running singleProcMode", taskExecutionModule.GetExecutionModuleMode() == TaskExecutionModule.TaskExecutionModuleMode.SingleProcMode);
Assertion.Assert("Expected EngineProxy for TEM running in singleProc mode to return false for IsRunningMultipleNodes", engineProxy.IsRunningMultipleNodes == false);
// Verify TEM is running MultiProc mode before we can test to make sure EngineProxy is correctly using the value
// Verify TEM is running MultiProc mode before we can test to make sure EngineProxy is correctly using the value
TaskExecutionModule.TaskExecutionModuleMode moduleMode = taskExecutionModule2.GetExecutionModuleMode();
Assertion.Assert("Expected TEM to be not be running SingleProcMode",moduleMode != TaskExecutionModule.TaskExecutionModuleMode.SingleProcMode);
Assertion.Assert("Expected EngineProxy for TEM running in MultiProc mode to return true for IsRunningMultipleNodes", engineProxy2.IsRunningMultipleNodes);
@ -620,7 +620,7 @@ namespace Microsoft.Build.UnitTests
// string childProjectFullPath = ObjectModelHelpers.CreateFileInTempProjectDirectory("child.proj", @"
// <Project ToolsVersion='44.0' xmlns='http://schemas.microsoft.com/developer/msbuild/2003'>
// <UsingTask TaskName='CreateItem' AssemblyName='Microsoft.Build.Tasks.v3.5, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'/>
// <UsingTask TaskName='CreateItem' AssemblyName='Microsoft.Build.Tasks.v3.5, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'/>
// <Target Name='BuildTarget'>
// <CreateItem Include='BuildTargetRan'>
// <Output TaskParameter='Include' ItemName='BuildTargetRan'/>

Просмотреть файл

@ -752,13 +752,13 @@ namespace Microsoft.Build.UnitTests.EscapingInProjects_Tests
/// <summary>
/// Build a .SLN file using MSBuild. The .SLN and the projects contained within
/// have all sorts of crazy characters in their name (courtesy of DanMose who apparently
/// have all sorts of different characters in their name (courtesy of DanMose who apparently
/// just ran his fingers up and down the on the upper row of his keyboard :) ). There
/// is even a P2P reference between the two projects in the .SLN.
/// </summary>
/// <owner>RGoel</owner>
[Test]
public void SolutionWithLotsaCrazyCharacters()
public void SolutionWithLotsaDifferentCharacters()
{
if (ToolLocationHelper.GetPathToDotNetFramework(TargetDotNetFrameworkVersion.Version35) == null)
{

Просмотреть файл

@ -984,7 +984,7 @@ namespace Microsoft.Build.UnitTests
}
/// <summary>
/// Lame but simple way to get the lookup from another thread
/// Bad but simple way to get the lookup from another thread
/// </summary>
private static Lookup lookupPassedBetweenThreads;

Просмотреть файл

@ -290,7 +290,7 @@ namespace Microsoft.Build.UnitTests
}
/// <summary>
/// Parses the crazy string passed into AssertItemsMatch and returns a list of ITaskItems.
/// Parses the different string passed into AssertItemsMatch and returns a list of ITaskItems.
/// </summary>
/// <param name="expectedItemsString"></param>
/// <returns></returns>

Просмотреть файл

@ -24,7 +24,7 @@ namespace Microsoft.Build.Framework
/// An explicit version of this class. Must be incremented whenever new members are added. Derived classes should override
/// the property to return the version actually being implemented.
/// </summary>
public virtual int Version => Version1; // Not updated since we have not shipped 17.0 yet. This comment is meant to bypass RequiredVersionBumps check in build.ps1 for PR #8336. If the changes in the file are cosmetic, change PR# in this comment to silence the build error on CI build.
public virtual int Version => Version1; // Not updated since we have not shipped 17.0 yet. This comment is meant to bypass RequiredVersionBumps check in build.ps1 for PR #470646. If the changes in the file are cosmetic, change PR# in this comment to silence the build error on CI build.
/// <summary>
/// Returns <see langword="true"/> if the given message importance is not guaranteed to be ignored by registered loggers.

Просмотреть файл

@ -316,7 +316,7 @@ namespace Microsoft.Build.Eventing
}
/// <summary>
/// Call this method to notify listeners of profiling for the method that removes blacklisted references from the reference table. It puts primary and dependency references in invalid file lists.
/// Call this method to notify listeners of profiling for the method that removes denylisted references from the reference table. It puts primary and dependency references in invalid file lists.
/// </summary>
[Event(35, Keywords = Keywords.All)]
public void RarRemoveReferencesMarkedForExclusionStart()

Просмотреть файл

@ -499,7 +499,7 @@ namespace Microsoft.Build.UnitTests
}
/// <summary>
/// Parses the crazy string passed into AssertItemsMatch and returns a list of ITaskItems.
/// Parses the string passed into AssertItemsMatch and returns a list of ITaskItems.
/// </summary>
/// <param name="expectedItemsString"></param>
/// <returns></returns>
@ -1346,7 +1346,7 @@ namespace Microsoft.Build.UnitTests
/// </summary>
private static void BuildProjectWithNewOM(string content, ref MockLogger logger, out bool result, bool allowTaskCrash, Dictionary<string, string> globalProperties = null)
{
// Replace the crazy quotes with real ones
// Replace the nonstandard quotes with real ones
content = ObjectModelHelpers.CleanupFileContents(content);
Project project = new Project(XmlReader.Create(new StringReader(content)), globalProperties, toolsVersion: null);
@ -1372,7 +1372,7 @@ namespace Microsoft.Build.UnitTests
public static BuildResult BuildProjectContentUsingBuildManager(string content, MockLogger logger, BuildParameters parameters = null)
{
// Replace the crazy quotes with real ones
// Replace the nonstandard quotes with real ones
content = ObjectModelHelpers.CleanupFileContents(content);
using (var env = TestEnvironment.Create())
@ -1426,7 +1426,7 @@ namespace Microsoft.Build.UnitTests
}
/// <summary>
/// Verify that a drive enumerating wildcard warning is logged or exception is thrown.
/// Verify that a drive enumerating wildcard warning is logged or exception is thrown.
/// </summary>
internal static void CleanContentsAndBuildTargetWithDriveEnumeratingWildcard(string content, string failOnDriveEnumerationEnvVar, string targetName, ExpectedBuildResult expectedBuildResult, ITestOutputHelper testOutput = null)
{

Просмотреть файл

@ -187,15 +187,15 @@ namespace Microsoft.Build.UnitTests.ResolveAssemblyReference_Tests.VersioningAnd
/// - An app.config was passed in that promotes UnifyMe version from 1.0.0.0 to 2.0.0.0
/// - Version 1.0.0.0 of UnifyMe exists.
/// - Version 2.0.0.0 of UnifyMe exists.
/// -Version 2.0.0.0 of UnifyMe is in the Black List
/// -Version 2.0.0.0 of UnifyMe is in the Deny List
/// Expected:
/// - There should be a warning indicating that DependsOnUnified has a dependency UnifyMe 2.0.0.0 which is not in a TargetFrameworkSubset.
/// - There will be no unified message.
/// Rationale:
/// Strongly named dependencies should unify according to the bindingRedirects in the app.config, if the unified version is in the black list it should be removed and warned.
/// Strongly named dependencies should unify according to the bindingRedirects in the app.config, if the unified version is in the deny list it should be removed and warned.
/// </summary>
[Fact]
public void ExistsPromotedDependencyInTheBlackList()
public void ExistsPromotedDependencyInTheDenyList()
{
string implicitRedistListContents =
"<FileList Redist='Microsoft-Windows-CLRCoreComp' >" +

Просмотреть файл

@ -73,7 +73,7 @@ namespace Microsoft.Build.UnitTests.ResolveAssemblyReference_Tests
"</FileList >";
/// <summary>
/// The contents of a subsetFile which only contain the Microsoft.Build.Engine assembly in the white list
/// The contents of a subsetFile which only contain the Microsoft.Build.Engine assembly in the allow list
/// </summary>
private string _engineOnlySubset =
"<FileList Redist='Microsoft-Windows-CLRCoreComp' >" +
@ -81,7 +81,7 @@ namespace Microsoft.Build.UnitTests.ResolveAssemblyReference_Tests
"</FileList >";
/// <summary>
/// The contents of a subsetFile which only contain the System.Xml assembly in the white list
/// The contents of a subsetFile which only contain the System.Xml assembly in the allow list
/// </summary>
private string _xmlOnlySubset =
"<FileList Redist='Microsoft-Windows-CLRCoreComp' >" +
@ -89,7 +89,7 @@ namespace Microsoft.Build.UnitTests.ResolveAssemblyReference_Tests
"</FileList >";
/// <summary>
/// The contents of a subsetFile which contain both the Microsoft.Build.Engine and System.Xml assemblies in the white list
/// The contents of a subsetFile which contain both the Microsoft.Build.Engine and System.Xml assemblies in the allow list
/// </summary>
private string _engineAndXmlSubset =
"<FileList Redist='Microsoft-Windows-CLRCoreComp' >" +
@ -5566,39 +5566,39 @@ namespace Microsoft.Build.UnitTests.ResolveAssemblyReference_Tests
}
/// <summary>
/// Test the case where the redist list is empty and we pass in an empty set of white lists
/// We should return null as there is no point generating a white list if there is nothing to subtract from.
/// ResolveAssemblyReference will see this as null and log a warning indicating no redist assemblies were found therefore no black list could be
/// Test the case where the redist list is empty and we pass in an empty set of allow lists
/// We should return null as there is no point generating an allow list if there is nothing to subtract from.
/// ResolveAssemblyReference will see this as null and log a warning indicating no redist assemblies were found therefore no deny list could be
/// generated
/// </summary>
[Fact]
public void RedistListGenerateBlackListEmptyAssemblyInfoNoRedistAssemblies()
public void RedistListGenerateDenyListEmptyAssemblyInfoNoRedistAssemblies()
{
RedistList redistList = RedistList.GetRedistList(Array.Empty<AssemblyTableInfo>());
List<Exception> whiteListErrors = new List<Exception>();
List<string> whiteListErrorFileNames = new List<string>();
Dictionary<string, string> blackList = redistList.GenerateBlackList(Array.Empty<AssemblyTableInfo>(), whiteListErrors, whiteListErrorFileNames);
Assert.Null(blackList); // "Should return null if the AssemblyTableInfo is empty and the redist list is empty"
List<Exception> allowListErrors = new List<Exception>();
List<string> allowListErrorFileNames = new List<string>();
Dictionary<string, string> denyList = redistList.GenerateDenyList(Array.Empty<AssemblyTableInfo>(), allowListErrors, allowListErrorFileNames);
Assert.Null(denyList); // "Should return null if the AssemblyTableInfo is empty and the redist list is empty"
}
/// <summary>
/// Verify that when we go to generate a black list but there were no subset list files passed in that we get NO black list generated as there is nothing to subtract.
/// Verify that when we go to generate a deny list but there were no subset list files passed in that we get NO deny list generated as there is nothing to subtract.
/// Nothing meaning, we don't have any matching subset list files to say there are no good files.
/// </summary>
[Fact]
public void RedistListGenerateBlackListEmptyAssemblyInfoWithRedistAssemblies()
public void RedistListGenerateDenyListEmptyAssemblyInfoWithRedistAssemblies()
{
string redistFile = CreateGenericRedistList();
try
{
AssemblyTableInfo redistListInfo = new AssemblyTableInfo(redistFile, "TargetFrameworkDirectory");
RedistList redistList = RedistList.GetRedistList(new AssemblyTableInfo[] { redistListInfo });
List<Exception> whiteListErrors = new List<Exception>();
List<string> whiteListErrorFileNames = new List<string>();
Dictionary<string, string> blackList = redistList.GenerateBlackList(Array.Empty<AssemblyTableInfo>(), whiteListErrors, whiteListErrorFileNames);
List<Exception> allowListErrors = new List<Exception>();
List<string> allowListErrorFileNames = new List<string>();
Dictionary<string, string> denyList = redistList.GenerateDenyList(Array.Empty<AssemblyTableInfo>(), allowListErrors, allowListErrorFileNames);
// Since there were no white list expect the black list to return null
Assert.Empty(blackList); // "Expected to have no assemblies in the black list"
// Since there were no allow list expect the deny list to return null
Assert.Empty(denyList); // "Expected to have no assemblies in the deny list"
}
finally
{
@ -5607,32 +5607,32 @@ namespace Microsoft.Build.UnitTests.ResolveAssemblyReference_Tests
}
/// <summary>
/// Test the case where the subset lists cannot be read. The expectation is that the black list will be empty as we have no proper white lists to compare it to.
/// Test the case where the subset lists cannot be read. The expectation is that the deny list will be empty as we have no proper allow lists to compare it to.
/// </summary>
[Fact]
public void RedistListGenerateBlackListNotFoundSubsetFiles()
public void RedistListGenerateDenyListNotFoundSubsetFiles()
{
string redistFile = CreateGenericRedistList();
try
{
AssemblyTableInfo redistListInfo = new AssemblyTableInfo(redistFile, "TargetFrameworkDirectory");
RedistList redistList = RedistList.GetRedistList(new AssemblyTableInfo[] { redistListInfo });
List<Exception> whiteListErrors = new List<Exception>();
List<string> whiteListErrorFileNames = new List<string>();
List<Exception> allowListErrors = new List<Exception>();
List<string> allowListErrorFileNames = new List<string>();
Dictionary<string, string> blackList = redistList.GenerateBlackList(
Dictionary<string, string> denyList = redistList.GenerateDenyList(
new AssemblyTableInfo[]
{
new AssemblyTableInfo("c:\\RandomDirectory.xml", "TargetFrameworkDirectory"),
new AssemblyTableInfo("c:\\AnotherRandomDirectory.xml", "TargetFrameworkDirectory")
},
whiteListErrors,
whiteListErrorFileNames);
allowListErrors,
allowListErrorFileNames);
// Since there were no white list expect the black list to return null
Assert.Empty(blackList); // "Expected to have no assemblies in the black list"
Assert.Equal(2, whiteListErrors.Count); // "Expected there to be two errors in the whiteListErrors, one for each missing file"
Assert.Equal(2, whiteListErrorFileNames.Count); // "Expected there to be two errors in the whiteListErrorFileNames, one for each missing file"
// Since there were no allow list expect the deny list to return null
Assert.Empty(denyList); // "Expected to have no assemblies in the deny list"
Assert.Equal(2, allowListErrors.Count); // "Expected there to be two errors in the allowListErrors, one for each missing file"
Assert.Equal(2, allowListErrorFileNames.Count); // "Expected there to be two errors in the allowListErrorFileNames, one for each missing file"
}
finally
{
@ -5642,10 +5642,10 @@ namespace Microsoft.Build.UnitTests.ResolveAssemblyReference_Tests
/// <summary>
/// Test the case where there is random goo in the subsetList file. Expect the file to not be read in and a warning indicating the file was skipped due to a read error.
/// This should also cause the white list to be empty as the badly formatted file was the only whitelist subset file.
/// This should also cause the allow list to be empty as the badly formatted file was the only allowlist subset file.
/// </summary>
[Fact]
public void RedistListGenerateBlackListGarbageSubsetListFiles()
public void RedistListGenerateDenyListGarbageSubsetListFiles()
{
string redistFile = CreateGenericRedistList();
string garbageSubsetFile = FileUtilities.GetTemporaryFileName();
@ -5658,14 +5658,14 @@ namespace Microsoft.Build.UnitTests.ResolveAssemblyReference_Tests
AssemblyTableInfo redistListInfo = new AssemblyTableInfo(redistFile, "TargetFrameworkDirectory");
AssemblyTableInfo subsetListInfo = new AssemblyTableInfo(garbageSubsetFile, "TargetFrameworkDirectory");
RedistList redistList = RedistList.GetRedistList(new AssemblyTableInfo[] { redistListInfo });
List<Exception> whiteListErrors = new List<Exception>();
List<string> whiteListErrorFileNames = new List<string>();
Dictionary<string, string> blackList = redistList.GenerateBlackList(new AssemblyTableInfo[] { subsetListInfo }, whiteListErrors, whiteListErrorFileNames);
List<Exception> allowListErrors = new List<Exception>();
List<string> allowListErrorFileNames = new List<string>();
Dictionary<string, string> denyList = redistList.GenerateDenyList(new AssemblyTableInfo[] { subsetListInfo }, allowListErrors, allowListErrorFileNames);
Assert.Empty(blackList); // "Expected to have no assemblies in the black list"
Assert.Single(whiteListErrors); // "Expected there to be an error in the whiteListErrors"
Assert.Single(whiteListErrorFileNames); // "Expected there to be an error in the whiteListErrorFileNames"
Assert.DoesNotContain("MSB3257", ((Exception)whiteListErrors[0]).Message); // "Expect to not have the null redist warning"
Assert.Empty(denyList); // "Expected to have no assemblies in the deny list"
Assert.Single(allowListErrors); // "Expected there to be an error in the allowListErrors"
Assert.Single(allowListErrorFileNames); // "Expected there to be an error in the allowListErrorFileNames"
Assert.DoesNotContain("MSB3257", ((Exception)allowListErrors[0]).Message); // "Expect to not have the null redist warning"
}
finally
{
@ -5681,7 +5681,7 @@ namespace Microsoft.Build.UnitTests.ResolveAssemblyReference_Tests
///
/// Expected:
/// Expect a warning that a redist list or subset list has no redist name.
/// There should be no black list generated as no sub set lists were read in.
/// There should be no deny list generated as no sub set lists were read in.
///
/// Rational:
/// If we have no redist name to compare to the redist list redist name we cannot subtract the lists correctly.
@ -5703,16 +5703,16 @@ namespace Microsoft.Build.UnitTests.ResolveAssemblyReference_Tests
AssemblyTableInfo redistListInfo = new AssemblyTableInfo(redistFile, "TargetFrameworkDirectory");
AssemblyTableInfo subsetListInfo = new AssemblyTableInfo(subsetFile, "TargetFrameworkDirectory");
RedistList redistList = RedistList.GetRedistList(new AssemblyTableInfo[] { redistListInfo });
List<Exception> whiteListErrors = new List<Exception>();
List<string> whiteListErrorFileNames = new List<string>();
Dictionary<string, string> blackList = redistList.GenerateBlackList(new AssemblyTableInfo[] { subsetListInfo }, whiteListErrors, whiteListErrorFileNames);
List<Exception> allowListErrors = new List<Exception>();
List<string> allowListErrorFileNames = new List<string>();
Dictionary<string, string> denyList = redistList.GenerateDenyList(new AssemblyTableInfo[] { subsetListInfo }, allowListErrors, allowListErrorFileNames);
// If the names do not match then i expect there to be no black list items
Assert.Empty(blackList); // "Expected to have no assembly in the black list"
Assert.Single(whiteListErrors); // "Expected there to be one error in the whiteListErrors"
Assert.Single(whiteListErrorFileNames); // "Expected there to be one error in the whiteListErrorFileNames"
// If the names do not match then i expect there to be no deny list items
Assert.Empty(denyList); // "Expected to have no assembly in the deny list"
Assert.Single(allowListErrors); // "Expected there to be one error in the allowListErrors"
Assert.Single(allowListErrorFileNames); // "Expected there to be one error in the allowListErrorFileNames"
string message = ResourceUtilities.FormatResourceStringStripCodeAndKeyword("ResolveAssemblyReference.NoSubSetRedistListName", subsetFile);
Assert.Contains(message, ((Exception)whiteListErrors[0]).Message); // "Expected assertion to contain correct error code"
Assert.Contains(message, ((Exception)allowListErrors[0]).Message); // "Expected assertion to contain correct error code"
}
finally
{
@ -5727,7 +5727,7 @@ namespace Microsoft.Build.UnitTests.ResolveAssemblyReference_Tests
/// Subset list which has a redist name and entries
///
/// Expected:
/// Expect no black list to be generated and no warnings to be emitted
/// Expect no deny list to be generated and no warnings to be emitted
///
/// Rational:
/// Since the redist list name is null or empty we have no way of matching any subset list up to it.
@ -5756,14 +5756,14 @@ namespace Microsoft.Build.UnitTests.ResolveAssemblyReference_Tests
AssemblyTableInfo redistListInfo = new AssemblyTableInfo(redistFile, "TargetFrameworkDirectory");
AssemblyTableInfo subsetListInfo = new AssemblyTableInfo(subsetFile, "TargetFrameworkDirectory");
RedistList redistList = RedistList.GetRedistList(new AssemblyTableInfo[] { redistListInfo });
List<Exception> whiteListErrors = new List<Exception>();
List<string> whiteListErrorFileNames = new List<string>();
Dictionary<string, string> blackList = redistList.GenerateBlackList(new AssemblyTableInfo[] { subsetListInfo }, whiteListErrors, whiteListErrorFileNames);
List<Exception> allowListErrors = new List<Exception>();
List<string> allowListErrorFileNames = new List<string>();
Dictionary<string, string> denyList = redistList.GenerateDenyList(new AssemblyTableInfo[] { subsetListInfo }, allowListErrors, allowListErrorFileNames);
// If the names do not match then i expect there to be no black list items
Assert.Empty(blackList); // "Expected to have no assembly in the black list"
Assert.Empty(whiteListErrors); // "Expected there to be no errors in the whiteListErrors"
Assert.Empty(whiteListErrorFileNames); // "Expected there to be no errors in the whiteListErrorFileNames"
// If the names do not match then i expect there to be no deny list items
Assert.Empty(denyList); // "Expected to have no assembly in the deny list"
Assert.Empty(allowListErrors); // "Expected there to be no errors in the allowListErrors"
Assert.Empty(allowListErrorFileNames); // "Expected there to be no errors in the allowListErrorFileNames"
}
finally
{
@ -5778,11 +5778,11 @@ namespace Microsoft.Build.UnitTests.ResolveAssemblyReference_Tests
/// Subset list which has entries but has a different redist name than the redist list
///
/// Expected:
/// There should be no black list generated as no sub set lists with matching names were found.
/// There should be no deny list generated as no sub set lists with matching names were found.
///
/// Rational:
/// If the redist name does not match then that subset list should not be subtracted from the redist list.
/// We only add assemblies to the black list if there is a corosponding white list even if it is empty to inform us what assemblies are good and which are not.
/// We only add assemblies to the deny list if there is a corosponding allow list even if it is empty to inform us what assemblies are good and which are not.
/// </summary>
[Fact]
public void RedistListDifferentNameToSubSet()
@ -5801,14 +5801,14 @@ namespace Microsoft.Build.UnitTests.ResolveAssemblyReference_Tests
AssemblyTableInfo redistListInfo = new AssemblyTableInfo(redistFile, "TargetFrameworkDirectory");
AssemblyTableInfo subsetListInfo = new AssemblyTableInfo(subsetFile, "TargetFrameworkDirectory");
RedistList redistList = RedistList.GetRedistList(new AssemblyTableInfo[] { redistListInfo });
List<Exception> whiteListErrors = new List<Exception>();
List<string> whiteListErrorFileNames = new List<string>();
Dictionary<string, string> blackList = redistList.GenerateBlackList(new AssemblyTableInfo[] { subsetListInfo }, whiteListErrors, whiteListErrorFileNames);
List<Exception> allowListErrors = new List<Exception>();
List<string> allowListErrorFileNames = new List<string>();
Dictionary<string, string> denyList = redistList.GenerateDenyList(new AssemblyTableInfo[] { subsetListInfo }, allowListErrors, allowListErrorFileNames);
// If the names do not match then i expect there to be no black list items
Assert.Empty(blackList); // "Expected to have no assembly in the black list"
Assert.Empty(whiteListErrors); // "Expected there to be no error in the whiteListErrors"
Assert.Empty(whiteListErrorFileNames); // "Expected there to be no error in the whiteListErrorFileNames"
// If the names do not match then i expect there to be no deny list items
Assert.Empty(denyList); // "Expected to have no assembly in the deny list"
Assert.Empty(allowListErrors); // "Expected there to be no error in the allowListErrors"
Assert.Empty(allowListErrorFileNames); // "Expected there to be no error in the allowListErrorFileNames"
}
finally
{
@ -5819,7 +5819,7 @@ namespace Microsoft.Build.UnitTests.ResolveAssemblyReference_Tests
/// <summary>
/// Test the case where the subset list has the same name as the redist list but it has no entries In this case
/// the black list should contain ALL redist list entries because there are no white list files to remove from the black list.
/// the deny list should contain ALL redist list entries because there are no allow list files to remove from the deny list.
/// </summary>
[Fact]
public void RedistListEmptySubsetMatchingName()
@ -5836,19 +5836,19 @@ namespace Microsoft.Build.UnitTests.ResolveAssemblyReference_Tests
AssemblyTableInfo redistListInfo = new AssemblyTableInfo(redistFile, "TargetFrameworkDirectory");
AssemblyTableInfo subsetListInfo = new AssemblyTableInfo(subsetFile, "TargetFrameworkDirectory");
RedistList redistList = RedistList.GetRedistList(new AssemblyTableInfo[] { redistListInfo });
List<Exception> whiteListErrors = new List<Exception>();
List<string> whiteListErrorFileNames = new List<string>();
Dictionary<string, string> blackList = redistList.GenerateBlackList(new AssemblyTableInfo[] { subsetListInfo }, whiteListErrors, whiteListErrorFileNames);
List<Exception> allowListErrors = new List<Exception>();
List<string> allowListErrorFileNames = new List<string>();
Dictionary<string, string> denyList = redistList.GenerateDenyList(new AssemblyTableInfo[] { subsetListInfo }, allowListErrors, allowListErrorFileNames);
// If the names do not match then i expect there to be no black list items
Assert.Equal(2, blackList.Count); // "Expected to have two assembly in the black list"
Assert.Empty(whiteListErrors); // "Expected there to be no error in the whiteListErrors"
Assert.Empty(whiteListErrorFileNames); // "Expected there to be no error in the whiteListErrorFileNames"
// If the names do not match then i expect there to be no deny list items
Assert.Equal(2, denyList.Count); // "Expected to have two assembly in the deny list"
Assert.Empty(allowListErrors); // "Expected there to be no error in the allowListErrors"
Assert.Empty(allowListErrorFileNames); // "Expected there to be no error in the allowListErrorFileNames"
ArrayList whiteListErrors2 = new ArrayList();
ArrayList whiteListErrorFileNames2 = new ArrayList();
Dictionary<string, string> blackList2 = redistList.GenerateBlackList(new AssemblyTableInfo[] { subsetListInfo }, whiteListErrors, whiteListErrorFileNames);
Assert.Same(blackList, blackList2);
ArrayList allowListErrors2 = new ArrayList();
ArrayList allowListErrorFileNames2 = new ArrayList();
Dictionary<string, string> denyList2 = redistList.GenerateDenyList(new AssemblyTableInfo[] { subsetListInfo }, allowListErrors, allowListErrorFileNames);
Assert.Same(denyList, denyList2);
}
finally
{
@ -5859,8 +5859,8 @@ namespace Microsoft.Build.UnitTests.ResolveAssemblyReference_Tests
/// <summary>
/// Test the case where, no redist assemblies are read in.
/// In this case no blacklist can be generated.
/// We should get a warning informing us that we could not create a black list.
/// In this case no denylist can be generated.
/// We should get a warning informing us that we could not create a deny list.
/// </summary>
[Fact]
public void RedistListNoAssembliesinRedistList()
@ -5908,10 +5908,10 @@ namespace Microsoft.Build.UnitTests.ResolveAssemblyReference_Tests
/// <summary>
/// Test the case where the subset list is a subset of the redist list. Make sure that
/// even though there are two files in the redist list that only one shows up in the black list.
/// even though there are two files in the redist list that only one shows up in the deny list.
/// </summary>
[Fact]
public void RedistListGenerateBlackListGoodListsSubsetIsSubsetOfRedist()
public void RedistListGenerateDenyListGoodListsSubsetIsSubsetOfRedist()
{
string redistFile = CreateGenericRedistList();
string goodSubsetFile = FileUtilities.GetTemporaryFileName();
@ -5922,14 +5922,14 @@ namespace Microsoft.Build.UnitTests.ResolveAssemblyReference_Tests
AssemblyTableInfo redistListInfo = new AssemblyTableInfo(redistFile, "TargetFrameworkDirectory");
AssemblyTableInfo subsetListInfo = new AssemblyTableInfo(goodSubsetFile, "TargetFrameworkDirectory");
RedistList redistList = RedistList.GetRedistList(new AssemblyTableInfo[] { redistListInfo });
List<Exception> whiteListErrors = new List<Exception>();
List<string> whiteListErrorFileNames = new List<string>();
Dictionary<string, string> blackList = redistList.GenerateBlackList(new AssemblyTableInfo[] { subsetListInfo }, whiteListErrors, whiteListErrorFileNames);
List<Exception> allowListErrors = new List<Exception>();
List<string> allowListErrorFileNames = new List<string>();
Dictionary<string, string> denyList = redistList.GenerateDenyList(new AssemblyTableInfo[] { subsetListInfo }, allowListErrors, allowListErrorFileNames);
Assert.Single(blackList); // "Expected to have one assembly in the black list"
Assert.True(blackList.ContainsKey("System.Xml, Version=2.0.0.0, Culture=Neutral, PublicKeyToken=b03f5f7f11d50a3a")); // "Expected System.xml to be in the black list"
Assert.Empty(whiteListErrors); // "Expected there to be no error in the whiteListErrors"
Assert.Empty(whiteListErrorFileNames); // "Expected there to be no error in the whiteListErrorFileNames"
Assert.Single(denyList); // "Expected to have one assembly in the deny list"
Assert.True(denyList.ContainsKey("System.Xml, Version=2.0.0.0, Culture=Neutral, PublicKeyToken=b03f5f7f11d50a3a")); // "Expected System.xml to be in the deny list"
Assert.Empty(allowListErrors); // "Expected there to be no error in the allowListErrors"
Assert.Empty(allowListErrorFileNames); // "Expected there to be no error in the allowListErrorFileNames"
}
finally
{
@ -5939,12 +5939,12 @@ namespace Microsoft.Build.UnitTests.ResolveAssemblyReference_Tests
}
/// <summary>
/// Test the case where we generate a black list based on a set of subset file paths, and then ask for
/// another black list using the same file paths. We expect to get the exact same Dictionary out
/// Test the case where we generate a deny list based on a set of subset file paths, and then ask for
/// another deny list using the same file paths. We expect to get the exact same Dictionary out
/// as it should be pulled from the cache.
/// </summary>
[Fact]
public void RedistListGenerateBlackListVerifyBlackListCache()
public void RedistListGenerateDenyListVerifyDenyListCache()
{
string redistFile = CreateGenericRedistList();
string goodSubsetFile = FileUtilities.GetTemporaryFileName();
@ -5955,20 +5955,20 @@ namespace Microsoft.Build.UnitTests.ResolveAssemblyReference_Tests
AssemblyTableInfo redistListInfo = new AssemblyTableInfo(redistFile, "TargetFrameworkDirectory");
AssemblyTableInfo subsetListInfo = new AssemblyTableInfo(goodSubsetFile, "TargetFrameworkDirectory");
RedistList redistList = RedistList.GetRedistList(new AssemblyTableInfo[] { redistListInfo });
List<Exception> whiteListErrors = new List<Exception>();
List<string> whiteListErrorFileNames = new List<string>();
Dictionary<string, string> blackList = redistList.GenerateBlackList(new AssemblyTableInfo[] { subsetListInfo }, whiteListErrors, whiteListErrorFileNames);
List<Exception> allowListErrors = new List<Exception>();
List<string> allowListErrorFileNames = new List<string>();
Dictionary<string, string> denyList = redistList.GenerateDenyList(new AssemblyTableInfo[] { subsetListInfo }, allowListErrors, allowListErrorFileNames);
// Since there were no white list expect the black list to return null
Assert.Single(blackList); // "Expected to have one assembly in the black list"
Assert.True(blackList.ContainsKey("System.Xml, Version=2.0.0.0, Culture=Neutral, PublicKeyToken=b03f5f7f11d50a3a")); // "Expected System.xml to be in the black list"
Assert.Empty(whiteListErrors); // "Expected there to be no error in the whiteListErrors"
Assert.Empty(whiteListErrorFileNames); // "Expected there to be no error in the whiteListErrorFileNames"
// Since there were no allow list expect the deny list to return null
Assert.Single(denyList); // "Expected to have one assembly in the deny list"
Assert.True(denyList.ContainsKey("System.Xml, Version=2.0.0.0, Culture=Neutral, PublicKeyToken=b03f5f7f11d50a3a")); // "Expected System.xml to be in the deny list"
Assert.Empty(allowListErrors); // "Expected there to be no error in the allowListErrors"
Assert.Empty(allowListErrorFileNames); // "Expected there to be no error in the allowListErrorFileNames"
List<Exception> whiteListErrors2 = new List<Exception>();
List<string> whiteListErrorFileNames2 = new List<string>();
Dictionary<string, string> blackList2 = redistList.GenerateBlackList(new AssemblyTableInfo[] { subsetListInfo }, whiteListErrors2, whiteListErrorFileNames2);
Assert.Same(blackList, blackList2);
List<Exception> allowListErrors2 = new List<Exception>();
List<string> allowListErrorFileNames2 = new List<string>();
Dictionary<string, string> denyList2 = redistList.GenerateDenyList(new AssemblyTableInfo[] { subsetListInfo }, allowListErrors2, allowListErrorFileNames2);
Assert.Same(denyList, denyList2);
}
finally
{
@ -5978,14 +5978,14 @@ namespace Microsoft.Build.UnitTests.ResolveAssemblyReference_Tests
}
/// <summary>
/// Test the case where the white list and the redist list are identical
/// In this case the black list should be empty.
/// Test the case where the allow list and the redist list are identical
/// In this case the deny list should be empty.
///
/// We are also in a way testing the combining of subset files as we read in one assembly from two
/// different subset lists while the redist list already contains both assemblies.
/// </summary>
[Fact]
public void RedistListGenerateBlackListGoodListsSubsetIsSameAsRedistList()
public void RedistListGenerateDenyListGoodListsSubsetIsSameAsRedistList()
{
string redistFile = CreateGenericRedistList();
string goodSubsetFile = FileUtilities.GetTemporaryFileName();
@ -6000,13 +6000,13 @@ namespace Microsoft.Build.UnitTests.ResolveAssemblyReference_Tests
AssemblyTableInfo subsetListInfo2 = new AssemblyTableInfo(goodSubsetFile2, "TargetFrameworkDirectory");
RedistList redistList = RedistList.GetRedistList(new AssemblyTableInfo[] { redistListInfo });
List<Exception> whiteListErrors = new List<Exception>();
List<string> whiteListErrorFileNames = new List<string>();
Dictionary<string, string> blackList = redistList.GenerateBlackList(new AssemblyTableInfo[] { subsetListInfo, subsetListInfo2 }, whiteListErrors, whiteListErrorFileNames);
// Since there were no white list expect the black list to return null
Assert.Empty(blackList); // "Expected to have no assemblies in the black list"
Assert.Empty(whiteListErrors); // "Expected there to be no error in the whiteListErrors"
Assert.Empty(whiteListErrorFileNames); // "Expected there to be no error in the whiteListErrorFileNames"
List<Exception> allowListErrors = new List<Exception>();
List<string> allowListErrorFileNames = new List<string>();
Dictionary<string, string> denyList = redistList.GenerateDenyList(new AssemblyTableInfo[] { subsetListInfo, subsetListInfo2 }, allowListErrors, allowListErrorFileNames);
// Since there were no allow list expect the deny list to return null
Assert.Empty(denyList); // "Expected to have no assemblies in the deny list"
Assert.Empty(allowListErrors); // "Expected there to be no error in the allowListErrors"
Assert.Empty(allowListErrorFileNames); // "Expected there to be no error in the allowListErrorFileNames"
}
finally
{
@ -6016,13 +6016,13 @@ namespace Microsoft.Build.UnitTests.ResolveAssemblyReference_Tests
}
/// <summary>
/// Test the case where the white list is a superset of the redist list.
/// This means there are more assemblies in the white list than in the black list.
/// Test the case where the allow list is a superset of the redist list.
/// This means there are more assemblies in the allow list than in the deny list.
///
/// The black list should be empty.
/// The deny list should be empty.
/// </summary>
[Fact]
public void RedistListGenerateBlackListGoodListsSubsetIsSuperSet()
public void RedistListGenerateDenyListGoodListsSubsetIsSuperSet()
{
string redistFile = CreateGenericRedistList();
string goodSubsetFile = FileUtilities.GetTemporaryFileName();
@ -6039,14 +6039,14 @@ namespace Microsoft.Build.UnitTests.ResolveAssemblyReference_Tests
AssemblyTableInfo redistListInfo = new AssemblyTableInfo(redistFile, "TargetFrameworkDirectory");
AssemblyTableInfo subsetListInfo = new AssemblyTableInfo(goodSubsetFile, "TargetFrameworkDirectory");
RedistList redistList = RedistList.GetRedistList(new AssemblyTableInfo[] { redistListInfo });
List<Exception> whiteListErrors = new List<Exception>();
List<string> whiteListErrorFileNames = new List<string>();
Dictionary<string, string> blackList = redistList.GenerateBlackList(new AssemblyTableInfo[] { subsetListInfo }, whiteListErrors, whiteListErrorFileNames);
List<Exception> allowListErrors = new List<Exception>();
List<string> allowListErrorFileNames = new List<string>();
Dictionary<string, string> denyList = redistList.GenerateDenyList(new AssemblyTableInfo[] { subsetListInfo }, allowListErrors, allowListErrorFileNames);
// Since there were no white list expect the black list to return null
Assert.Empty(blackList); // "Expected to have no assemblies in the black list"
Assert.Empty(whiteListErrors); // "Expected there to be no error in the whiteListErrors"
Assert.Empty(whiteListErrorFileNames); // "Expected there to be no error in the whiteListErrorFileNames"
// Since there were no allow list expect the deny list to return null
Assert.Empty(denyList); // "Expected to have no assemblies in the deny list"
Assert.Empty(allowListErrors); // "Expected there to be no error in the allowListErrors"
Assert.Empty(allowListErrorFileNames); // "Expected there to be no error in the allowListErrorFileNames"
}
finally
{
@ -6060,7 +6060,7 @@ namespace Microsoft.Build.UnitTests.ResolveAssemblyReference_Tests
/// list are case sensitive or not, they should not be case sensitive.
/// </summary>
[Fact]
public void RedistListGenerateBlackListGoodListsCheckCaseInsensitive()
public void RedistListGenerateDenyListGoodListsCheckCaseInsensitive()
{
string redistFile = CreateGenericRedistList();
string goodSubsetFile = FileUtilities.GetTemporaryFileName();
@ -6071,14 +6071,14 @@ namespace Microsoft.Build.UnitTests.ResolveAssemblyReference_Tests
AssemblyTableInfo redistListInfo = new AssemblyTableInfo(redistFile, "TargetFrameworkDirectory");
AssemblyTableInfo subsetListInfo = new AssemblyTableInfo(goodSubsetFile, "TargetFrameworkDirectory");
RedistList redistList = RedistList.GetRedistList(new AssemblyTableInfo[] { redistListInfo });
List<Exception> whiteListErrors = new List<Exception>();
List<string> whiteListErrorFileNames = new List<string>();
Dictionary<string, string> blackList = redistList.GenerateBlackList(new AssemblyTableInfo[] { subsetListInfo }, whiteListErrors, whiteListErrorFileNames);
List<Exception> allowListErrors = new List<Exception>();
List<string> allowListErrorFileNames = new List<string>();
Dictionary<string, string> denyList = redistList.GenerateDenyList(new AssemblyTableInfo[] { subsetListInfo }, allowListErrors, allowListErrorFileNames);
// Since there were no white list expect the black list to return null
Assert.Empty(blackList); // "Expected to have no assemblies in the black list"
Assert.Empty(whiteListErrors); // "Expected there to be no error in the whiteListErrors"
Assert.Empty(whiteListErrorFileNames); // "Expected there to be no error in the whiteListErrorFileNames"
// Since there were no allow list expect the deny list to return null
Assert.Empty(denyList); // "Expected to have no assemblies in the deny list"
Assert.Empty(allowListErrors); // "Expected there to be no error in the allowListErrors"
Assert.Empty(allowListErrorFileNames); // "Expected there to be no error in the allowListErrorFileNames"
}
finally
{
@ -6088,11 +6088,11 @@ namespace Microsoft.Build.UnitTests.ResolveAssemblyReference_Tests
}
/// <summary>
/// Verify that when we go to generate a black list but there were no subset list files passed in that we get NO black list generated as there is nothing to subtract.
/// Verify that when we go to generate a deny list but there were no subset list files passed in that we get NO deny list generated as there is nothing to subtract.
/// Nothing meaning, we don't have any matching subset list files to say there are no good files.
/// </summary>
[Fact]
public void RedistListGenerateBlackListGoodListsMultipleIdenticalAssembliesInRedistList()
public void RedistListGenerateDenyListGoodListsMultipleIdenticalAssembliesInRedistList()
{
string redistFile = FileUtilities.GetTemporaryFileName();
string goodSubsetFile = FileUtilities.GetTemporaryFileName();
@ -6112,14 +6112,14 @@ namespace Microsoft.Build.UnitTests.ResolveAssemblyReference_Tests
AssemblyTableInfo redistListInfo = new AssemblyTableInfo(redistFile, "TargetFrameworkDirectory");
AssemblyTableInfo subsetListInfo = new AssemblyTableInfo(goodSubsetFile, "TargetFrameworkDirectory");
RedistList redistList = RedistList.GetRedistList(new AssemblyTableInfo[] { redistListInfo });
List<Exception> whiteListErrors = new List<Exception>();
List<string> whiteListErrorFilesNames = new List<string>();
Dictionary<string, string> blackList = redistList.GenerateBlackList(new AssemblyTableInfo[] { subsetListInfo }, whiteListErrors, whiteListErrorFilesNames);
List<Exception> allowListErrors = new List<Exception>();
List<string> allowListErrorFilesNames = new List<string>();
Dictionary<string, string> denyList = redistList.GenerateDenyList(new AssemblyTableInfo[] { subsetListInfo }, allowListErrors, allowListErrorFilesNames);
// Since there were no white list expect the black list to return null
Assert.Empty(blackList); // "Expected to have no assemblies in the black list"
Assert.Empty(whiteListErrors); // "Expected there to be no error in the whiteListErrors"
Assert.Empty(whiteListErrorFilesNames); // "Expected there to be no error in the whiteListErrorFileNames"
// Since there were no allow list expect the deny list to return null
Assert.Empty(denyList); // "Expected to have no assemblies in the deny list"
Assert.Empty(allowListErrors); // "Expected there to be no error in the allowListErrors"
Assert.Empty(allowListErrorFilesNames); // "Expected there to be no error in the allowListErrorFileNames"
}
finally
{
@ -6314,10 +6314,10 @@ namespace Microsoft.Build.UnitTests.ResolveAssemblyReference_Tests
}
/// <summary>
/// A null black list should be the same as an empty one.
/// A null deny list should be the same as an empty one.
/// </summary>
[Fact]
public void ReferenceTableNullBlackList()
public void ReferenceTableNullDenyList()
{
TaskLoggingHelper log = new TaskLoggingHelper(new ResolveAssemblyReference());
ReferenceTable referenceTable = MakeEmptyReferenceTable(log);
@ -6339,10 +6339,10 @@ namespace Microsoft.Build.UnitTests.ResolveAssemblyReference_Tests
}
/// <summary>
/// Test the case where the blacklist is empty.
/// Test the case where the denylist is empty.
/// </summary>
[Fact]
public void ReferenceTableEmptyBlackList()
public void ReferenceTableEmptyDenyList()
{
TaskLoggingHelper log = new TaskLoggingHelper(new ResolveAssemblyReference());
ReferenceTable referenceTable = MakeEmptyReferenceTable(log);
@ -6364,10 +6364,10 @@ namespace Microsoft.Build.UnitTests.ResolveAssemblyReference_Tests
}
/// <summary>
/// Verify the case where there are primary references in the reference table which are also in the black list
/// Verify the case where there are primary references in the reference table which are also in the deny list
/// </summary>
[Fact]
public void ReferenceTablePrimaryItemInBlackList()
public void ReferenceTablePrimaryItemInDenyList()
{
MockEngine mockEngine = new MockEngine(_output);
ResolveAssemblyReference rar = new ResolveAssemblyReference();
@ -6385,12 +6385,12 @@ namespace Microsoft.Build.UnitTests.ResolveAssemblyReference_Tests
table.Add(engineAssemblyName, reference);
table.Add(xmlAssemblyName, new Reference(isWinMDFile, fileExists, getRuntimeVersion));
var blackList = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase);
blackList[engineAssemblyName.FullName] = null;
var denyList = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase);
denyList[engineAssemblyName.FullName] = null;
string[] targetFrameworks = new string[] { "Client", "Web" };
string subSetName = ResolveAssemblyReference.GenerateSubSetName(targetFrameworks, null);
referenceTable.MarkReferencesForExclusion(blackList);
referenceTable.MarkReferencesForExclusion(denyList);
referenceTable.RemoveReferencesMarkedForExclusion(false, subSetName);
Dictionary<AssemblyNameExtension, Reference> table2 = referenceTable.References;
@ -6403,10 +6403,10 @@ namespace Microsoft.Build.UnitTests.ResolveAssemblyReference_Tests
}
/// <summary>
/// Verify the case where there are primary references in the reference table which are also in the black list
/// Verify the case where there are primary references in the reference table which are also in the deny list
/// </summary>
[Fact]
public void ReferenceTablePrimaryItemInBlackListSpecificVersionTrue()
public void ReferenceTablePrimaryItemInDenyListSpecificVersionTrue()
{
MockEngine mockEngine = new MockEngine(_output);
ResolveAssemblyReference rar = new ResolveAssemblyReference();
@ -6425,11 +6425,11 @@ namespace Microsoft.Build.UnitTests.ResolveAssemblyReference_Tests
table.Add(engineAssemblyName, reference);
table.Add(xmlAssemblyName, new Reference(isWinMDFile, fileExists, getRuntimeVersion));
var blackList = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase);
blackList[engineAssemblyName.FullName] = null;
var denyList = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase);
denyList[engineAssemblyName.FullName] = null;
string[] targetFrameworks = new string[] { "Client", "Web" };
string subSetName = ResolveAssemblyReference.GenerateSubSetName(targetFrameworks, null);
referenceTable.MarkReferencesForExclusion(blackList);
referenceTable.MarkReferencesForExclusion(denyList);
referenceTable.RemoveReferencesMarkedForExclusion(false, subSetName);
Dictionary<AssemblyNameExtension, Reference> table2 = referenceTable.References;
@ -6483,7 +6483,7 @@ namespace Microsoft.Build.UnitTests.ResolveAssemblyReference_Tests
/// Verify the case where we just want to remove the references before conflict resolution and not print out the warning.
/// </summary>
[Fact]
public void ReferenceTablePrimaryItemInBlackListRemoveOnlyNoWarn()
public void ReferenceTablePrimaryItemInDenyListRemoveOnlyNoWarn()
{
MockEngine mockEngine = new MockEngine(_output);
ResolveAssemblyReference rar = new ResolveAssemblyReference();
@ -6501,9 +6501,9 @@ namespace Microsoft.Build.UnitTests.ResolveAssemblyReference_Tests
table.Add(engineAssemblyName, reference);
table.Add(xmlAssemblyName, new Reference(isWinMDFile, fileExists, getRuntimeVersion));
var blackList = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase);
blackList[engineAssemblyName.FullName] = null;
referenceTable.MarkReferencesForExclusion(blackList);
var denyList = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase);
denyList[engineAssemblyName.FullName] = null;
referenceTable.MarkReferencesForExclusion(denyList);
referenceTable.RemoveReferencesMarkedForExclusion(true, String.Empty);
Dictionary<AssemblyNameExtension, Reference> table2 = referenceTable.References;
@ -6517,16 +6517,16 @@ namespace Microsoft.Build.UnitTests.ResolveAssemblyReference_Tests
}
/// <summary>
/// Testing case enginePrimary -> dataDependencyReference->sqlDependencyReference : sqlDependencyReference is in black list
/// Testing case enginePrimary -> dataDependencyReference->sqlDependencyReference : sqlDependencyReference is in deny list
/// expect to see one dependency warning message
/// </summary>
[Fact]
public void ReferenceTableDependentItemsInBlackList()
public void ReferenceTableDependentItemsInDenyList()
{
ReferenceTable referenceTable;
MockEngine mockEngine;
ResolveAssemblyReference rar;
Dictionary<string, string> blackList;
Dictionary<string, string> denyList;
AssemblyNameExtension engineAssemblyName = new AssemblyNameExtension("Microsoft.Build.Engine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a");
AssemblyNameExtension dataAssemblyName = new AssemblyNameExtension("System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a");
AssemblyNameExtension sqlclientAssemblyName = new AssemblyNameExtension("System.SqlClient, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a");
@ -6550,7 +6550,7 @@ namespace Microsoft.Build.UnitTests.ResolveAssemblyReference_Tests
InitializeMockEngine(out referenceTable, out mockEngine, out rar);
AddReferencesToReferenceTable(referenceTable, engineAssemblyName, dataAssemblyName, sqlclientAssemblyName, xmlAssemblyName, enginePrimaryReference, dataDependencyReference, sqlDependencyReference, xmlPrimaryReference);
InitializeExclusionList(referenceTable, new AssemblyNameExtension[] { sqlclientAssemblyName }, out blackList);
InitializeExclusionList(referenceTable, new AssemblyNameExtension[] { sqlclientAssemblyName }, out denyList);
string subsetName = ResolveAssemblyReference.GenerateSubSetName(new string[] { "Client" }, null);
string warningMessage = rar.Log.FormatResourceString("ResolveAssemblyReference.FailBecauseDependentAssemblyInExclusionList", taskItem.ItemSpec, sqlclientAssemblyName.FullName, subsetName);
@ -6559,17 +6559,17 @@ namespace Microsoft.Build.UnitTests.ResolveAssemblyReference_Tests
/// <summary>
/// Testing case enginePrimary -> dataDependencyReference->sqlDependencyReference
/// and enginePrimary->sqlDependencyReference: sqlDependencyReference is in black list
/// and enginePrimary->sqlDependencyReference: sqlDependencyReference is in deny list
/// and systemxml->enginePrimary
/// expect to see one dependency warning message
/// </summary>
[Fact]
public void ReferenceTableDependentItemsInBlackList2()
public void ReferenceTableDependentItemsInDenyList2()
{
ReferenceTable referenceTable;
MockEngine mockEngine;
ResolveAssemblyReference rar;
Dictionary<string, string> blackList;
Dictionary<string, string> denyList;
AssemblyNameExtension engineAssemblyName = new AssemblyNameExtension("Microsoft.Build.Engine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a");
AssemblyNameExtension dataAssemblyName = new AssemblyNameExtension("System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a");
AssemblyNameExtension sqlclientAssemblyName = new AssemblyNameExtension("System.SqlClient, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a");
@ -6594,7 +6594,7 @@ namespace Microsoft.Build.UnitTests.ResolveAssemblyReference_Tests
InitializeMockEngine(out referenceTable, out mockEngine, out rar);
AddReferencesToReferenceTable(referenceTable, engineAssemblyName, dataAssemblyName, sqlclientAssemblyName, xmlAssemblyName, enginePrimaryReference, dataDependencyReference, sqlDependencyReference, xmlPrimaryReference);
InitializeExclusionList(referenceTable, new AssemblyNameExtension[] { sqlclientAssemblyName }, out blackList);
InitializeExclusionList(referenceTable, new AssemblyNameExtension[] { sqlclientAssemblyName }, out denyList);
string subsetName = ResolveAssemblyReference.GenerateSubSetName(new string[] { "Client" }, null);
string warningMessage = rar.Log.FormatResourceString("ResolveAssemblyReference.FailBecauseDependentAssemblyInExclusionList", taskItem.ItemSpec, sqlclientAssemblyName.FullName, subsetName);
@ -6605,12 +6605,12 @@ namespace Microsoft.Build.UnitTests.ResolveAssemblyReference_Tests
/// Testing case enginePrimary->XmlPrimary with XMLPrimary in the BL
/// </summary>
[Fact]
public void ReferenceTablePrimaryToPrimaryDependencyWithOneInBlackList()
public void ReferenceTablePrimaryToPrimaryDependencyWithOneInDenyList()
{
ReferenceTable referenceTable;
MockEngine mockEngine;
ResolveAssemblyReference rar;
Dictionary<string, string> blackList;
Dictionary<string, string> denyList;
AssemblyNameExtension engineAssemblyName = new AssemblyNameExtension("Microsoft.Build.Engine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a");
AssemblyNameExtension xmlAssemblyName = new AssemblyNameExtension("System.Xml, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a");
Reference enginePrimaryReference = new Reference(isWinMDFile, fileExists, getRuntimeVersion);
@ -6630,7 +6630,7 @@ namespace Microsoft.Build.UnitTests.ResolveAssemblyReference_Tests
InitializeMockEngine(out referenceTable, out mockEngine, out rar);
AddReferencesToReferenceTable(referenceTable, engineAssemblyName, null, null, xmlAssemblyName, enginePrimaryReference, null, null, xmlPrimaryReference);
InitializeExclusionList(referenceTable, new AssemblyNameExtension[] { xmlAssemblyName }, out blackList);
InitializeExclusionList(referenceTable, new AssemblyNameExtension[] { xmlAssemblyName }, out denyList);
string subsetName = ResolveAssemblyReference.GenerateSubSetName(new string[] { "Client" }, null);
string warningMessage = rar.Log.FormatResourceString("ResolveAssemblyReference.FailBecauseDependentAssemblyInExclusionList", taskItem.ItemSpec, xmlAssemblyName.FullName, subsetName);
string warningMessage2 = rar.Log.FormatResourceString("ResolveAssemblyReference.FailedToResolveReferenceBecausePrimaryAssemblyInExclusionList", taskItem2.ItemSpec, subsetName);
@ -6646,12 +6646,12 @@ namespace Microsoft.Build.UnitTests.ResolveAssemblyReference_Tests
/// Testing case enginePrimary->XmlPrimary->dataDependency with dataDependency in the BL
/// </summary>
[Fact]
public void ReferenceTablePrimaryToPrimaryToDependencyWithOneInBlackList()
public void ReferenceTablePrimaryToPrimaryToDependencyWithOneInDenyList()
{
ReferenceTable referenceTable;
MockEngine mockEngine;
ResolveAssemblyReference rar;
Dictionary<string, string> blackList;
Dictionary<string, string> denyList;
AssemblyNameExtension engineAssemblyName = new AssemblyNameExtension("Microsoft.Build.Engine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a");
AssemblyNameExtension xmlAssemblyName = new AssemblyNameExtension("System.Xml, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a");
AssemblyNameExtension dataAssemblyName = new AssemblyNameExtension("System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a");
@ -6676,7 +6676,7 @@ namespace Microsoft.Build.UnitTests.ResolveAssemblyReference_Tests
InitializeMockEngine(out referenceTable, out mockEngine, out rar);
AddReferencesToReferenceTable(referenceTable, engineAssemblyName, dataAssemblyName, null, xmlAssemblyName, enginePrimaryReference, dataDependencyReference, null, xmlPrimaryReference);
InitializeExclusionList(referenceTable, new AssemblyNameExtension[] { dataAssemblyName }, out blackList);
InitializeExclusionList(referenceTable, new AssemblyNameExtension[] { dataAssemblyName }, out denyList);
string subsetName = ResolveAssemblyReference.GenerateSubSetName(new string[] { "Client" }, null);
string warningMessage = rar.Log.FormatResourceString("ResolveAssemblyReference.FailBecauseDependentAssemblyInExclusionList", taskItem.ItemSpec, dataAssemblyName.FullName, subsetName);
@ -6692,16 +6692,16 @@ namespace Microsoft.Build.UnitTests.ResolveAssemblyReference_Tests
/// <summary>
/// Testing case enginePrimary -> dataDependencyReference->sqlDependencyReference
/// and xmlPrimary->sqlDependencyReference: sqlDependencyReference is in black list
/// and xmlPrimary->sqlDependencyReference: sqlDependencyReference is in deny list
/// expect to see one dependency warning message
/// </summary>
[Fact]
public void ReferenceTableDependentItemsInBlackList3()
public void ReferenceTableDependentItemsInDenyList3()
{
ReferenceTable referenceTable;
MockEngine mockEngine;
ResolveAssemblyReference rar;
Dictionary<string, string> blackList;
Dictionary<string, string> denyList;
AssemblyNameExtension engineAssemblyName = new AssemblyNameExtension("Microsoft.Build.Engine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a");
AssemblyNameExtension dataAssemblyName = new AssemblyNameExtension("System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a");
AssemblyNameExtension sqlclientAssemblyName = new AssemblyNameExtension("System.SqlClient, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a");
@ -6728,7 +6728,7 @@ namespace Microsoft.Build.UnitTests.ResolveAssemblyReference_Tests
InitializeMockEngine(out referenceTable, out mockEngine, out rar);
AddReferencesToReferenceTable(referenceTable, engineAssemblyName, dataAssemblyName, sqlclientAssemblyName, xmlAssemblyName, enginePrimaryReference, dataDependencyReference, sqlDependencyReference, xmlPrimaryReference);
InitializeExclusionList(referenceTable, new AssemblyNameExtension[] { sqlclientAssemblyName }, out blackList);
InitializeExclusionList(referenceTable, new AssemblyNameExtension[] { sqlclientAssemblyName }, out denyList);
string subsetName = ResolveAssemblyReference.GenerateSubSetName(new string[] { "Client" }, null);
string warningMessage = rar.Log.FormatResourceString("ResolveAssemblyReference.FailBecauseDependentAssemblyInExclusionList", taskItem.ItemSpec, sqlclientAssemblyName.FullName, subsetName);
@ -6738,11 +6738,11 @@ namespace Microsoft.Build.UnitTests.ResolveAssemblyReference_Tests
/// <summary>
/// Testing case enginePrimary -> dataDependencyReference->sqlDependencyReference
/// and xmlPrimary->dataDependencyReference: sqlDependencyReference is in black list
/// and xmlPrimary->dataDependencyReference: sqlDependencyReference is in deny list
/// expect to see one dependency warning message
/// </summary>
[Fact]
public void ReferenceTableDependentItemsInBlackList4()
public void ReferenceTableDependentItemsInDenyList4()
{
ReferenceTable referenceTable = new ReferenceTable(null, false, false, false, false, Array.Empty<string>(), null, null, null, null, null, null, SystemProcessorArchitecture.None, fileExists, null, null, null,
#if FEATURE_WIN32_REGISTRY
@ -6751,7 +6751,7 @@ namespace Microsoft.Build.UnitTests.ResolveAssemblyReference_Tests
null, null, null, new Version("4.0"), null, null, null, true, false, null, null, false, null, WarnOrErrorOnTargetArchitectureMismatchBehavior.None, false, false, null);
MockEngine mockEngine;
ResolveAssemblyReference rar;
Dictionary<string, string> blackList;
Dictionary<string, string> denyList;
AssemblyNameExtension engineAssemblyName = new AssemblyNameExtension("Microsoft.Build.Engine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a");
AssemblyNameExtension dataAssemblyName = new AssemblyNameExtension("System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a");
AssemblyNameExtension sqlclientAssemblyName = new AssemblyNameExtension("System.SqlClient, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a");
@ -6778,7 +6778,7 @@ namespace Microsoft.Build.UnitTests.ResolveAssemblyReference_Tests
InitializeMockEngine(out referenceTable, out mockEngine, out rar);
AddReferencesToReferenceTable(referenceTable, engineAssemblyName, dataAssemblyName, sqlclientAssemblyName, xmlAssemblyName, enginePrimaryReference, dataDependencyReference, sqlDependencyReference, xmlPrimaryReference);
InitializeExclusionList(referenceTable, new AssemblyNameExtension[] { sqlclientAssemblyName }, out blackList);
InitializeExclusionList(referenceTable, new AssemblyNameExtension[] { sqlclientAssemblyName }, out denyList);
string subsetName = ResolveAssemblyReference.GenerateSubSetName(new string[] { "Client" }, null);
string warningMessage = rar.Log.FormatResourceString("ResolveAssemblyReference.FailBecauseDependentAssemblyInExclusionList", taskItem.ItemSpec, sqlclientAssemblyName.FullName, subsetName);
@ -6790,16 +6790,16 @@ namespace Microsoft.Build.UnitTests.ResolveAssemblyReference_Tests
/// Testing case enginePrimary -> dataDependencyReference->sqlDependencyReference
/// enginePrimary -> dataDependencyReference
/// xmlPrimaryReference ->DataDependency
/// dataDependencyReference and sqlDependencyReference are in black list
/// dataDependencyReference and sqlDependencyReference are in deny list
/// expect to see two dependency warning messages in the enginePrimaryCase and one in the xmlPrimarycase
/// </summary>
[Fact]
public void ReferenceTableDependentItemsInBlackList5()
public void ReferenceTableDependentItemsInDenyList5()
{
ReferenceTable referenceTable;
MockEngine mockEngine;
ResolveAssemblyReference rar;
Dictionary<string, string> blackList;
Dictionary<string, string> denyList;
AssemblyNameExtension engineAssemblyName = new AssemblyNameExtension("Microsoft.Build.Engine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a");
AssemblyNameExtension dataAssemblyName = new AssemblyNameExtension("System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a");
AssemblyNameExtension sqlclientAssemblyName = new AssemblyNameExtension("System.SqlClient, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a");
@ -6826,7 +6826,7 @@ namespace Microsoft.Build.UnitTests.ResolveAssemblyReference_Tests
InitializeMockEngine(out referenceTable, out mockEngine, out rar);
AddReferencesToReferenceTable(referenceTable, engineAssemblyName, dataAssemblyName, sqlclientAssemblyName, xmlAssemblyName, enginePrimaryReference, dataDependencyReference, sqlDependencyReference, xmlPrimaryReference);
InitializeExclusionList(referenceTable, new AssemblyNameExtension[] { sqlclientAssemblyName, dataAssemblyName }, out blackList);
InitializeExclusionList(referenceTable, new AssemblyNameExtension[] { sqlclientAssemblyName, dataAssemblyName }, out denyList);
string subsetName = ResolveAssemblyReference.GenerateSubSetName(new string[] { "Client" }, null);
string warningMessage = rar.Log.FormatResourceString("ResolveAssemblyReference.FailBecauseDependentAssemblyInExclusionList", taskItem.ItemSpec, sqlclientAssemblyName.FullName, subsetName);
@ -6853,17 +6853,17 @@ namespace Microsoft.Build.UnitTests.ResolveAssemblyReference_Tests
/// Testing case
/// enginePrimary -> dataDependencyReference also enginePrimary->sqlDependencyReference specific version = true on the primary
/// xmlPrimaryReference ->dataDependencyReference specific version = false on the primary
/// dataDependencyReference and sqlDependencyReference is in the black list.
/// dataDependencyReference and sqlDependencyReference is in the deny list.
/// Expect to see one dependency warning messages xmlPrimarycase and no message for enginePrimary
/// Also expect to resolve all files except for xmlPrimaryReference
/// </summary>
[Fact]
public void ReferenceTableDependentItemsInBlackListPrimaryWithSpecificVersion()
public void ReferenceTableDependentItemsInDenyListPrimaryWithSpecificVersion()
{
ReferenceTable referenceTable;
MockEngine mockEngine;
ResolveAssemblyReference rar;
Dictionary<string, string> blackList;
Dictionary<string, string> denyList;
AssemblyNameExtension engineAssemblyName = new AssemblyNameExtension("Microsoft.Build.Engine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a");
AssemblyNameExtension dataAssemblyName = new AssemblyNameExtension("System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a");
AssemblyNameExtension sqlclientAssemblyName = new AssemblyNameExtension("System.SqlClient, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a");
@ -6894,7 +6894,7 @@ namespace Microsoft.Build.UnitTests.ResolveAssemblyReference_Tests
InitializeMockEngine(out referenceTable, out mockEngine, out rar);
AddReferencesToReferenceTable(referenceTable, engineAssemblyName, dataAssemblyName, sqlclientAssemblyName, xmlAssemblyName, enginePrimaryReference, dataDependencyReference, sqlDependencyReference, xmlPrimaryReference);
InitializeExclusionList(referenceTable, new AssemblyNameExtension[] { sqlclientAssemblyName, dataAssemblyName }, out blackList);
InitializeExclusionList(referenceTable, new AssemblyNameExtension[] { sqlclientAssemblyName, dataAssemblyName }, out denyList);
string subsetName = ResolveAssemblyReference.GenerateSubSetName(new string[] { "Client" }, null);
string warningMessage = rar.Log.FormatResourceString("ResolveAssemblyReference.FailBecauseDependentAssemblyInExclusionList", taskItem2.ItemSpec, dataAssemblyName.FullName, subsetName);
@ -6931,7 +6931,7 @@ namespace Microsoft.Build.UnitTests.ResolveAssemblyReference_Tests
}
/// <summary>
/// Verify the correct references are still in the references table and that references which are in the black list are not in the references table
/// Verify the correct references are still in the references table and that references which are in the deny list are not in the references table
/// Also verify any expected warning messages are seen in the log.
/// </summary>
private static void VerifyReferenceTable(ReferenceTable referenceTable, MockEngine mockEngine, AssemblyNameExtension engineAssemblyName, AssemblyNameExtension dataAssemblyName, AssemblyNameExtension sqlclientAssemblyName, AssemblyNameExtension xmlAssemblyName, string[] warningMessages)
@ -7088,7 +7088,7 @@ namespace Microsoft.Build.UnitTests.ResolveAssemblyReference_Tests
}
/// <summary>
/// Initialize the mock engine so we can look at the warning messages, also put the assembly name which is to be in the black list into the black list.
/// Initialize the mock engine so we can look at the warning messages, also put the assembly name which is to be in the deny list into the deny list.
/// Call remove references so that we can then validate the results.
/// </summary>
private void InitializeMockEngine(out ReferenceTable referenceTable, out MockEngine mockEngine, out ResolveAssemblyReference rar)
@ -7101,17 +7101,17 @@ namespace Microsoft.Build.UnitTests.ResolveAssemblyReference_Tests
}
/// <summary>
/// Initialize the black list and use it to remove references from the reference table
/// Initialize the deny list and use it to remove references from the reference table
/// </summary>
private void InitializeExclusionList(ReferenceTable referenceTable, AssemblyNameExtension[] assembliesForBlackList, out Dictionary<string, string> blackList)
private void InitializeExclusionList(ReferenceTable referenceTable, AssemblyNameExtension[] assembliesForDenyList, out Dictionary<string, string> denyList)
{
blackList = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase);
foreach (AssemblyNameExtension assemblyName in assembliesForBlackList)
denyList = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase);
foreach (AssemblyNameExtension assemblyName in assembliesForDenyList)
{
blackList[assemblyName.FullName] = null;
denyList[assemblyName.FullName] = null;
}
referenceTable.MarkReferencesForExclusion(blackList);
referenceTable.MarkReferencesForExclusion(denyList);
referenceTable.RemoveReferencesMarkedForExclusion(false, "Client");
}
@ -7344,7 +7344,7 @@ namespace Microsoft.Build.UnitTests.ResolveAssemblyReference_Tests
/// <summary>
/// This test will verify when the full client name is passed in and it appears in the TargetFrameworkSubsetList, that the
/// black list is not used.
/// deny list is not used.
/// </summary>
[Fact]
public void ResolveAssemblyReferenceVerifyFullClientName()
@ -7377,7 +7377,7 @@ namespace Microsoft.Build.UnitTests.ResolveAssemblyReference_Tests
/// <summary>
/// This test will verify when the full client name is passed in and it appears in the TargetFrameworkSubsetList, that the
/// black list is not used.
/// deny list is not used.
/// </summary>
[Fact]
public void ResolveAssemblyReferenceVerifyFullClientNameWithSubsetTables()
@ -7412,7 +7412,7 @@ namespace Microsoft.Build.UnitTests.ResolveAssemblyReference_Tests
/// <summary>
/// This test will verify when the full client name is passed in and it appears in the TargetFrameworkSubsetList, that the
/// black list is not used.
/// deny list is not used.
/// </summary>
[Fact]
public void ResolveAssemblyReferenceVerifyFullClientNameNoTablesPassedIn()
@ -7445,7 +7445,7 @@ namespace Microsoft.Build.UnitTests.ResolveAssemblyReference_Tests
}
/// <summary>
/// Verify the correct references are still in the references table and that references which are in the black list are not in the references table
/// Verify the correct references are still in the references table and that references which are in the deny list are not in the references table
/// Also verify any expected warning messages are seen in the log.
/// </summary>
private static void VerifyReferenceTable(ReferenceTable referenceTable, MockEngine mockEngine, AssemblyNameExtension engineAssemblyName, AssemblyNameExtension dataAssemblyName, AssemblyNameExtension sqlclientAssemblyName, AssemblyNameExtension xmlAssemblyName, string warningMessage, string warningMessage2)
@ -8240,7 +8240,7 @@ namespace Microsoft.Build.UnitTests.ResolveAssemblyReference_Tests
}
/// <summary>
/// Verify when a p2p (assemblies in the AssemblyFiles property) are passed to rar that we properly un-resolve them if they depend on references which are in the black list for the profile.
/// Verify when a p2p (assemblies in the AssemblyFiles property) are passed to rar that we properly un-resolve them if they depend on references which are in the deny list for the profile.
/// </summary>
[Fact]
public void Verifyp2pAndProfile()
@ -8288,7 +8288,7 @@ namespace Microsoft.Build.UnitTests.ResolveAssemblyReference_Tests
}
/// <summary>
/// Verify when a p2p (assemblies in the AssemblyFiles property) are passed to rar that we properly resolve them if they depend on references which are in the black list for the profile but have specific version set to true.
/// Verify when a p2p (assemblies in the AssemblyFiles property) are passed to rar that we properly resolve them if they depend on references which are in the deny list for the profile but have specific version set to true.
/// </summary>
[Fact]
public void Verifyp2pAndProfile2()
@ -8485,7 +8485,7 @@ namespace Microsoft.Build.UnitTests.ResolveAssemblyReference_Tests
}
/// <summary>
/// Make sure when reading in the full framework redist list or when reading in the white list xml files.
/// Make sure when reading in the full framework redist list or when reading in the allow list xml files.
/// Errors in reading the file should be logged as warnings and no assemblies should be excluded.
///
/// </summary>

Просмотреть файл

@ -88,15 +88,15 @@ namespace Microsoft.Build.UnitTests.ResolveAssemblyReference_Tests.VersioningAnd
/// - An app.config was passed in that promotes UnifyMe version from 1.0.0.0 to 2.0.0.0
/// - Version 1.0.0.0 of UnifyMe exists.
/// - Version 2.0.0.0 of UnifyMe exists.
/// -Version 2.0.0.0 of UnifyMe is in the Black List
/// -Version 2.0.0.0 of UnifyMe is in the Deny List
/// Expected:
/// - There should be a warning indicating that DependsOnUnified has a dependency UnifyMe 2.0.0.0 which is not in a TargetFrameworkSubset.
/// - There will be no unified message.
/// Rationale:
/// Strongly named dependencies should unify according to the bindingRedirects in the app.config, if the unified version is in the black list it should be removed and warned.
/// Strongly named dependencies should unify according to the bindingRedirects in the app.config, if the unified version is in the deny list it should be removed and warned.
/// </summary>
[Fact]
public void ExistsPromotedDependencyInTheBlackList()
public void ExistsPromotedDependencyInTheDenyList()
{
string engineOnlySubset =
"<FileList Redist='Microsoft-Windows-CLRCoreComp' >" +

Просмотреть файл

@ -100,15 +100,15 @@ namespace Microsoft.Build.UnitTests.ResolveAssemblyReference_Tests.VersioningAnd
/// - The AutoUnify flag is set to 'true'.
/// - Version 1.0.0.0 of UnifyMe exists.
/// - Version 2.0.0.0 of UnifyMe exists.
/// - DependsOnUnified 2.0.0.0 is on the black list.
/// - DependsOnUnified 2.0.0.0 is on the deny list.
/// Expected:
/// - There should be exactly one UnifyMe dependency returned and it should be version 1.0.0.0.
/// Rationale:
/// When AutoUnify is true, we need to resolve to the highest version of each particular assembly
/// dependency seen. However if the higher assembly is a dependency of an assembly in the black list it should not be considered during unification.
/// dependency seen. However if the higher assembly is a dependency of an assembly in the deny list it should not be considered during unification.
/// </summary>
[Fact]
public void ExistsWithPrimaryReferenceOnBlackList()
public void ExistsWithPrimaryReferenceOnDenyList()
{
string implicitRedistListContents =
"<FileList Redist='Microsoft-Windows-CLRCoreComp' >" +
@ -178,16 +178,16 @@ namespace Microsoft.Build.UnitTests.ResolveAssemblyReference_Tests.VersioningAnd
/// - The AutoUnify flag is set to 'true'.
/// - Version 1.0.0.0 of UnifyMe exists.
/// - Version 2.0.0.0 of UnifyMe exists.
/// - UnifyMe 2.0.0.0 is on the black list
/// - UnifyMe 2.0.0.0 is on the deny list
/// Expected:
/// - There should be exactly one UnifyMe dependency returned and it should be version 1.0.0.0.
/// Also there should be a warning about the primary reference DependsOnUnified 2.0.0.0 having a dependency which was in the black list.
/// Also there should be a warning about the primary reference DependsOnUnified 2.0.0.0 having a dependency which was in the deny list.
/// Rationale:
/// When AutoUnify is true, we need to resolve to the highest version of each particular assembly
/// dependency seen. However if the higher assembly is a dependency of an assembly in the black list it should not be considered during unification.
/// dependency seen. However if the higher assembly is a dependency of an assembly in the deny list it should not be considered during unification.
/// </summary>
[Fact]
public void ExistsPromotedDependencyInTheBlackList()
public void ExistsPromotedDependencyInTheDenyList()
{
string implicitRedistListContents =
"<FileList Redist='Microsoft-Windows-CLRCoreComp' >" +
@ -258,14 +258,14 @@ namespace Microsoft.Build.UnitTests.ResolveAssemblyReference_Tests.VersioningAnd
/// - The AutoUnify flag is set to 'true'.
/// - Version 1.0.0.0 of UnifyMe exists.
/// - Version 2.0.0.0 of UnifyMe exists.
/// - UnifyMe 2.0.0.0 is on the black list because it is higher than what is in the redist list, 1.0.0.0 is also in a black list because it is not in the subset but is in the redist list.
/// - UnifyMe 2.0.0.0 is on the deny list because it is higher than what is in the redist list, 1.0.0.0 is also in a deny list because it is not in the subset but is in the redist list.
/// Expected:
/// - There should be no UnifyMe dependency returned
/// There should be a warning indicating the primary reference DependsOnUnified 1.0.0.0 has a dependency that in the black list
/// There should be a warning indicating the primary reference DependsOnUnified 2.0.0.0 has a dependency that in the black list
/// There should be a warning indicating the primary reference DependsOnUnified 1.0.0.0 has a dependency that in the deny list
/// There should be a warning indicating the primary reference DependsOnUnified 2.0.0.0 has a dependency that in the deny list
/// </summary>
[Fact]
public void ExistsWithBothDependentReferenceOnBlackList()
public void ExistsWithBothDependentReferenceOnDenyList()
{
string implicitRedistListContents =
"<FileList Redist='Microsoft-Windows-CLRCoreComp' >" +
@ -333,7 +333,7 @@ namespace Microsoft.Build.UnitTests.ResolveAssemblyReference_Tests.VersioningAnd
/// - Version 1.0.0.0 of UnifyMe exists.
/// - Version 2.0.0.0 of UnifyMe exists.
/// - Version 3.0.0.0 of UnifyMe exists.
/// - Version 3.0.0.0 of DependsOn is on black list
/// - Version 3.0.0.0 of DependsOn is on deny list
/// Expected:
/// - There should be exactly one UnifyMe dependency returned and it should be version 2.0.0.0.
/// - There should be messages saying that 2.0.0.0 was unified from 1.0.0.0.
@ -341,7 +341,7 @@ namespace Microsoft.Build.UnitTests.ResolveAssemblyReference_Tests.VersioningAnd
/// AutoUnify works even when unifying multiple prior versions.
/// </summary>
[Fact]
public void MultipleUnifiedFromNamesMiddlePrimaryOnBlackList()
public void MultipleUnifiedFromNamesMiddlePrimaryOnDenyList()
{
string implicitRedistListContents =
"<FileList Redist='Microsoft-Windows-CLRCoreComp' >" +

Просмотреть файл

@ -226,7 +226,7 @@ namespace Microsoft.Build.Tasks
}
/// <summary>
/// A dependee may be removed because it or its dependee's are in the black list
/// A dependee may be removed because it or its dependee's are in the deny list
/// </summary>
internal void RemoveDependee(Reference dependeeToRemove)
{
@ -234,7 +234,7 @@ namespace Microsoft.Build.Tasks
}
/// <summary>
/// A dependency may be removed because it may not be referenced any more due this reference being in the black list or being removed due to it depending on something in the black list
/// A dependency may be removed because it may not be referenced any more due this reference being in the deny list or being removed due to it depending on something in the deny list
/// </summary>
internal void RemoveDependency(Reference dependencyToRemove)
{
@ -1140,7 +1140,7 @@ namespace Microsoft.Build.Tasks
/// <summary>
/// There are a number of properties which are set when we generate exclusion lists and it is useful to have this information on the references so that
/// the correct reasons can be logged for these references being in the black list.
/// the correct reasons can be logged for these references being in the deny list.
/// </summary>
internal class ExclusionListProperties
{

Просмотреть файл

@ -153,9 +153,9 @@ namespace Microsoft.Build.Tasks
/// <summary>
/// When we exclude an assembly from resolution because it is part of out exclusion list we need to let the user know why this is.
/// There can be a number of reasons each for un-resolving a reference, these reasons are encapsulated by a different black list. We need to log a specific message
/// depending on which black list we have found the offending assembly in. This delegate allows one to tie a set of logging messages to a black list so that when we
/// discover an assembly in the black list we can log the correct message.
/// There can be a number of reasons each for un-resolving a reference, these reasons are encapsulated by a different deny list. We need to log a specific message
/// depending on which deny list we have found the offending assembly in. This delegate allows one to tie a set of logging messages to a deny list so that when we
/// discover an assembly in the deny list we can log the correct message.
/// </summary>
internal delegate void LogExclusionReason(bool displayPrimaryReferenceMessage, AssemblyNameExtension assemblyName, Reference reference, ITaskItem referenceItem, string targetedFramework);
@ -1359,15 +1359,15 @@ namespace Microsoft.Build.Tasks
}
/// <summary>
/// This method will remove references from the reference table which are contained in the blacklist.
/// References which are primary references but are in the black list will be placed in the invalidResolvedFiles list.
/// References which are dependency references but are in the black list will be placed in the invalidResolvedDependencyFiles list.
/// This method will remove references from the reference table which are contained in the denylist.
/// References which are primary references but are in the deny list will be placed in the invalidResolvedFiles list.
/// References which are dependency references but are in the deny list will be placed in the invalidResolvedDependencyFiles list.
/// </summary>
internal void RemoveReferencesMarkedForExclusion(bool removeOnlyNoWarning, string subsetName)
{
MSBuildEventSource.Log.RarRemoveReferencesMarkedForExclusionStart();
{
// Create a table which will contain the references which are not in the black list
// Create a table which will contain the references which are not in the deny list
var goodReferences = new Dictionary<AssemblyNameExtension, Reference>(AssemblyNameComparer.GenericComparer);
// List of references which were removed from the reference table, we will loop through these and make sure that we get rid of the dependent references also.
@ -1381,7 +1381,7 @@ namespace Microsoft.Build.Tasks
subsetName = String.Empty;
}
// Go through each of the references, we go through this table because in general it will be considerably smaller than the blacklist. (10's of references vs 100's of black list items)
// Go through each of the references, we go through this table because in general it will be considerably smaller than the denylist. (10's of references vs 100's of deny list items)
foreach (KeyValuePair<AssemblyNameExtension, Reference> assembly in References)
{
AssemblyNameExtension assemblyName = assembly.Key;
@ -1389,14 +1389,14 @@ namespace Microsoft.Build.Tasks
AddToDependencyGraph(dependencyGraph, assemblyName, assemblyReference);
// Is the assembly name not in the black list. This means the assembly could be allowed.
// Is the assembly name not in the deny list. This means the assembly could be allowed.
bool isMarkedForExclusion = assemblyReference.ExclusionListLoggingProperties.IsInExclusionList;
LogExclusionReason logExclusionReason = assemblyReference.ExclusionListLoggingProperties.ExclusionReasonLogDelegate;
// Case one, the assembly is a primary reference
if (assemblyReference.IsPrimary)
{
// The assembly is good if it is not in the black list or it has specific version set to true.
// The assembly is good if it is not in the deny list or it has specific version set to true.
if (!isMarkedForExclusion || assemblyReference.WantSpecificVersion)
{
// Do not add the reference to the good list if it has been added to the removed references list, possibly because of us processing another reference.
@ -1415,16 +1415,16 @@ namespace Microsoft.Build.Tasks
// the current primary reference and they need to be removed.
ICollection<ITaskItem> dependees = assemblyReference.GetSourceItems();
// Need to deal with dependencies, this can also include primary references who are dependencies themselves and are in the black list
// Need to deal with dependencies, this can also include primary references who are dependencies themselves and are in the deny list
if (!assemblyReference.IsPrimary || (assemblyReference.IsPrimary && isMarkedForExclusion && (dependees?.Count > 1)))
{
// Does the assembly have specific version true, or does any of its primary parent references have specific version true.
// This is checked because, if an assembly is in the black list, the only way it can possibly be allowed is if
// This is checked because, if an assembly is in the deny list, the only way it can possibly be allowed is if
// ANY of the primary references which caused it have specific version set to true. To see if any primary references have the metadata we pass true to the method indicating
// we want to know if any primary references have specific version set to true.
bool hasSpecificVersionTrue = assemblyReference.CheckForSpecificVersionMetadataOnParentsReference(true);
// A dependency is "good" if it is not in the black list or any of its parents have specific version set to true
// A dependency is "good" if it is not in the deny list or any of its parents have specific version set to true
if (!isMarkedForExclusion || hasSpecificVersionTrue)
{
// Do not add the reference to the good list if it has been added to the removed references list, possibly because of us processing another reference.
@ -1434,8 +1434,8 @@ namespace Microsoft.Build.Tasks
}
}
// If the dependency is in the black list we need to remove the primary references which depend on this refernce.
// note, a reference can both be in the good references list and in the black list. This can happen if a multiple primary references
// If the dependency is in the deny list we need to remove the primary references which depend on this refernce.
// note, a reference can both be in the good references list and in the deny list. This can happen if a multiple primary references
// depend on a single dependency. The dependency can be good for one reference but not allowed for the other.
if (isMarkedForExclusion)
{
@ -1480,7 +1480,7 @@ namespace Microsoft.Build.Tasks
}
/// <summary>
/// We have determined the given assembly reference is in the black list, we now need to find the primary references which caused it and make sure those are removed from the list of references.
/// We have determined the given assembly reference is in the deny list, we now need to find the primary references which caused it and make sure those are removed from the list of references.
/// </summary>
private void RemoveDependencyMarkedForExclusion(LogExclusionReason logExclusionReason, bool removeOnlyNoWarning, string subsetName, Dictionary<AssemblyNameExtension, Reference> goodReferences, List<Reference> removedReferences, AssemblyNameExtension assemblyName, Reference assemblyReference)
{
@ -1528,7 +1528,7 @@ namespace Microsoft.Build.Tasks
}
/// <summary>
/// A primary references has been determined to be in the black list, it needs to be removed from the list of references by not being added to the list of good references
/// A primary references has been determined to be in the deny list, it needs to be removed from the list of references by not being added to the list of good references
/// and added to the list of removed references.
/// </summary>
private static void RemovePrimaryReferenceMarkedForExclusion(LogExclusionReason logExclusionReason, bool removeOnlyNoWarning, string subsetName, List<Reference> removedReferences, AssemblyNameExtension assemblyName, Reference assemblyReference)
@ -1561,7 +1561,7 @@ namespace Microsoft.Build.Tasks
/// <summary>
/// Go through the dependency graph and make sure that for a reference to remove that we get rid of all dependency assemblies which are not referenced by any other
/// assembly. The remove reference list should contain ALL primary references which should be removed because they, or one of their dependencies is in the black list.
/// assembly. The remove reference list should contain ALL primary references which should be removed because they, or one of their dependencies is in the deny list.
/// </summary>
/// <param name="removedReference">Reference to remove dependencies for</param>
/// <param name="referenceList">Reference list which contains reference to be used in unification and returned as resolved items</param>

Просмотреть файл

@ -2222,7 +2222,7 @@ namespace Microsoft.Build.Tasks
inclusionListSubsetTableInfo = GetInstalledAssemblyTableInfo(IgnoreDefaultInstalledAssemblySubsetTables, InstalledAssemblySubsetTables, new GetListPath(inclusionList.GetSubsetListPathsFromDisk), TargetFrameworkDirectories);
if (inclusionListSubsetTableInfo.Length > 0 && (redistList?.Count > 0))
{
exclusionList = redistList.GenerateBlackList(inclusionListSubsetTableInfo, inclusionListErrors, inclusionListErrorFilesNames);
exclusionList = redistList.GenerateDenyList(inclusionListSubsetTableInfo, inclusionListErrors, inclusionListErrorFilesNames);
}
else
{
@ -2772,7 +2772,7 @@ namespace Microsoft.Build.Tasks
// Any errors reading the profile redist list will already be logged, we do not need to re-log the errors here.
List<Exception> inclusionListErrors = new List<Exception>();
List<string> inclusionListErrorFilesNames = new List<string>();
exclusionList = fullFrameworkRedistList.GenerateBlackList(installedAssemblyTableInfo, inclusionListErrors, inclusionListErrorFilesNames);
exclusionList = fullFrameworkRedistList.GenerateDenyList(installedAssemblyTableInfo, inclusionListErrors, inclusionListErrorFilesNames);
}
// Could get into this situation if the redist list files were full of junk and no assemblies were read in.
@ -2895,7 +2895,7 @@ namespace Microsoft.Build.Tasks
}
}
Log.LogMessageFromResources(MessageImportance.Low, "ResolveAssemblyReference.TargetFrameworkWhiteListLogHeader");
Log.LogMessageFromResources(MessageImportance.Low, "ResolveAssemblyReference.TargetFrameworkAllowListLogHeader");
if (inclusionListSubsetTableInfo != null)
{
foreach (AssemblyTableInfo inclusionListInfo in inclusionListSubsetTableInfo)

Просмотреть файл

@ -99,11 +99,11 @@ namespace Microsoft.Build.Tasks
/// The culture will only be stripped if it is a valid culture identifier.
/// So for example,
///
/// MyCrazyFile.XX.txt
/// MyDifferentFile.XX.txt
///
/// will result in exactly the same file name:
///
/// MyCrazyFile.XX.txt
/// MyDifferentFile.XX.txt
///
/// because 'XX' is not a valid culture identifier.
/// </summary>

Просмотреть файл

@ -1300,7 +1300,7 @@ Copyright (C) Microsoft Corporation. All rights reserved.
============================================================
AssignLinkMetadata
For items of a certain set of whitelisted types, make sure that
For items of a certain set of allowlisted types, make sure that
if they are defined in a file other than the project file, that
they have "Link" metadata set to an appropriate default.
============================================================

Просмотреть файл

@ -66,8 +66,8 @@ namespace Microsoft.Build.Tasks
/// </summary>
private readonly ConcurrentDictionary<AssemblyNameExtension, AssemblyNameExtension> _remappingCache = new ConcurrentDictionary<AssemblyNameExtension, AssemblyNameExtension>(AssemblyNameComparer.GenericComparerConsiderRetargetable);
// List of cached BlackList RedistList objects, the key is a semi-colon delimited list of data file paths
private readonly ConcurrentDictionary<string, Dictionary<string, string>> _cachedBlackList = new ConcurrentDictionary<string, Dictionary<string, string>>(StringComparer.OrdinalIgnoreCase);
// List of cached DenyList RedistList objects, the key is a semi-colon delimited list of data file paths
private readonly ConcurrentDictionary<string, Dictionary<string, string>> _cachedDenyList = new ConcurrentDictionary<string, Dictionary<string, string>>(StringComparer.OrdinalIgnoreCase);
/***************Fields which are only set in the constructor and should not be modified by the class. **********************/
// Array of errors encountered while reading files.
@ -500,27 +500,27 @@ namespace Microsoft.Build.Tasks
}
/// <summary>
/// This method will take a list of AssemblyTableInfo and generate a black list by subtracting the
/// assemblies listed in the WhiteList from the RedistList.
/// This method will take a list of AssemblyTableInfo and generate a deny list by subtracting the
/// assemblies listed in the AllowList from the RedistList.
///
/// 1) If there are assemblies in the redist list and one or more client subset files are read in with matching names then
/// the subtraction will take place. If there were no matching redist lists read in the black list will be empty.
/// the subtraction will take place. If there were no matching redist lists read in the deny list will be empty.
///
/// 2) If the subset has a matching name but there are no files inside of it then the black list will contain ALL files in the redist list.
/// 2) If the subset has a matching name but there are no files inside of it then the deny list will contain ALL files in the redist list.
///
/// 3) If the redist list assembly has a null or empty redist name or the subset list has a null or empty subset name they will not be used for black list generation.
/// 3) If the redist list assembly has a null or empty redist name or the subset list has a null or empty subset name they will not be used for deny list generation.
///
/// When generating the blacklist, we will first see if the black list is in the appdomain wide cache
/// so that we do not regenerate one for multiple calls using the same whiteListAssemblyTableInfo.
/// When generating the denylist, we will first see if the deny list is in the appdomain wide cache
/// so that we do not regenerate one for multiple calls using the same allowListAssemblyTableInfo.
///
/// </summary>
/// <param name="whiteListAssemblyTableInfo">List of paths to white list xml files</param>
/// <param name="whiteListErrors">List of white listed errors</param>
/// <param name="whiteListErrorFileNames">List of white listed error file names</param>
/// <returns>A dictionary containing the full assembly names of black listed assemblies as the key, and null as the value.
/// <param name="allowListAssemblyTableInfo">List of paths to allow list xml files</param>
/// <param name="allowListErrors">List of allow listed errors</param>
/// <param name="allowListErrorFileNames">List of allow listed error file names</param>
/// <returns>A dictionary containing the full assembly names of deny listed assemblies as the key, and null as the value.
/// If there is no assemblies in the redist list null is returned.
/// </returns>
internal Dictionary<string, string> GenerateBlackList(AssemblyTableInfo[] whiteListAssemblyTableInfo, List<Exception> whiteListErrors, List<string> whiteListErrorFileNames)
internal Dictionary<string, string> GenerateDenyList(AssemblyTableInfo[] allowListAssemblyTableInfo, List<Exception> allowListErrors, List<string> allowListErrorFileNames)
{
// Return null if there are no assemblies in the redist list.
if (_assemblyList.Count == 0)
@ -528,44 +528,44 @@ namespace Microsoft.Build.Tasks
return null;
}
// Sort so that the same set of whiteListAssemblyTableInfo will generate the same key for the cache
Array.Sort(whiteListAssemblyTableInfo);
// Sort so that the same set of allowListAssemblyTableInfo will generate the same key for the cache
Array.Sort(allowListAssemblyTableInfo);
var keyBuilder = whiteListAssemblyTableInfo.Length > 0 ? new StringBuilder(whiteListAssemblyTableInfo[0].Descriptor) : new StringBuilder();
var keyBuilder = allowListAssemblyTableInfo.Length > 0 ? new StringBuilder(allowListAssemblyTableInfo[0].Descriptor) : new StringBuilder();
// Concatenate the paths to the whitelist xml files together to get the key into the blacklist cache.
for (int i = 1; i < whiteListAssemblyTableInfo.Length; ++i)
// Concatenate the paths to the allowlist xml files together to get the key into the denylist cache.
for (int i = 1; i < allowListAssemblyTableInfo.Length; ++i)
{
keyBuilder.Append(';');
keyBuilder.Append(whiteListAssemblyTableInfo[i].Descriptor);
keyBuilder.Append(allowListAssemblyTableInfo[i].Descriptor);
}
string key = keyBuilder.ToString();
if (!_cachedBlackList.TryGetValue(key, out Dictionary<string, string> returnTable))
if (!_cachedDenyList.TryGetValue(key, out Dictionary<string, string> returnTable))
{
var whiteListAssemblies = new List<AssemblyEntry>();
var allowListAssemblies = new List<AssemblyEntry>();
// Unique list of redist names in the subset files read in. We use this to make sure we are subtracting from the correct framework list.
var uniqueClientListNames = new Hashtable(StringComparer.OrdinalIgnoreCase);
// Get the assembly entries for the white list
foreach (AssemblyTableInfo info in whiteListAssemblyTableInfo)
// Get the assembly entries for the allow list
foreach (AssemblyTableInfo info in allowListAssemblyTableInfo)
{
var whiteListAssembliesReadIn = new List<AssemblyEntry>();
var allowListAssembliesReadIn = new List<AssemblyEntry>();
// Need to know how many errors are in the list before the read file call so that if the redist name is null due to an error
// we do not get a "redist name is null or empty" error when in actual fact it was a file not found error.
int errorsBeforeReadCall = whiteListErrors.Count;
int errorsBeforeReadCall = allowListErrors.Count;
// Read in the subset list file.
string redistName = ReadFile(info, whiteListAssembliesReadIn, whiteListErrors, whiteListErrorFileNames, null);
string redistName = ReadFile(info, allowListAssembliesReadIn, allowListErrors, allowListErrorFileNames, null);
// Get the client subset name which has been read in.
if (!String.IsNullOrEmpty(redistName))
{
// Populate the list of assemblies which are to be used as white list assemblies.
whiteListAssemblies.AddRange(whiteListAssembliesReadIn);
// Populate the list of assemblies which are to be used as allow list assemblies.
allowListAssemblies.AddRange(allowListAssembliesReadIn);
// We may have the same redist name for multiple files, we only want to get the set of unique names.
if (!uniqueClientListNames.ContainsKey(redistName))
@ -577,22 +577,22 @@ namespace Microsoft.Build.Tasks
{
// There are no extra errors reading in the subset list file which would have caused the redist list name to be null or empty.
// This means the redist name read in must be null or empty
if (whiteListErrors.Count == errorsBeforeReadCall)
if (allowListErrors.Count == errorsBeforeReadCall)
{
// The whiteList errors passes back problems reading the redist file through the use of an array containing exceptions
whiteListErrors.Add(new Exception(ResourceUtilities.FormatResourceStringStripCodeAndKeyword("ResolveAssemblyReference.NoSubSetRedistListName", info.Path)));
whiteListErrorFileNames.Add(info.Path);
// The allowList errors passes back problems reading the redist file through the use of an array containing exceptions
allowListErrors.Add(new Exception(ResourceUtilities.FormatResourceStringStripCodeAndKeyword("ResolveAssemblyReference.NoSubSetRedistListName", info.Path)));
allowListErrorFileNames.Add(info.Path);
}
}
}
// Dont care about the case of the assembly name
var blackList = new Hashtable(StringComparer.OrdinalIgnoreCase);
var denyList = new Hashtable(StringComparer.OrdinalIgnoreCase);
// Do we have any subset names?
bool uniqueClientNamesExist = uniqueClientListNames.Count > 0;
// Fill the hashtable with the entries, if there are no white list assemblies the black list will contain all assemblies in the redist list
// Fill the hashtable with the entries, if there are no allow list assemblies the deny list will contain all assemblies in the redist list
foreach (AssemblyEntry entry in _assemblyList)
{
string entryFullName = entry.FullName;
@ -605,32 +605,32 @@ namespace Microsoft.Build.Tasks
string hashKey = entryFullName + "," + redistName;
// If there were no subset list names read in we cannot generate a black list. (warnings will be logged as part of the reading of the subset list).
// If there were no subset list names read in we cannot generate a deny list. (warnings will be logged as part of the reading of the subset list).
if (uniqueClientNamesExist)
{
if (!blackList.ContainsKey(hashKey) && uniqueClientListNames.ContainsKey(redistName))
if (!denyList.ContainsKey(hashKey) && uniqueClientListNames.ContainsKey(redistName))
{
blackList[hashKey] = entryFullName;
denyList[hashKey] = entryFullName;
}
}
}
// Go through each of the white list assemblies and remove it from the black list. Do this based on the assembly name and the redist name
foreach (AssemblyEntry whiteListEntry in whiteListAssemblies)
// Go through each of the allow list assemblies and remove it from the deny list. Do this based on the assembly name and the redist name
foreach (AssemblyEntry allowListEntry in allowListAssemblies)
{
blackList.Remove(whiteListEntry.FullName + "," + whiteListEntry.RedistName);
denyList.Remove(allowListEntry.FullName + "," + allowListEntry.RedistName);
}
// The output dictionary needs to be just the full names and not the names + redist name
var blackListOfAssemblyNames = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase);
foreach (string name in blackList.Values)
var denyListOfAssemblyNames = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase);
foreach (string name in denyList.Values)
{
blackListOfAssemblyNames[name] = null;
denyListOfAssemblyNames[name] = null;
}
_cachedBlackList.TryAdd(key, blackListOfAssemblyNames);
_cachedDenyList.TryAdd(key, denyListOfAssemblyNames);
return blackListOfAssemblyNames;
return denyListOfAssemblyNames;
}
return returnTable;
@ -929,7 +929,7 @@ namespace Microsoft.Build.Tasks
}
/// <summary>
/// Internal class representing a redist list or whitelist and its corresponding framework directory.
/// Internal class representing a redist list or allowlist and its corresponding framework directory.
/// </summary>
internal class AssemblyTableInfo : IComparable
{
@ -955,7 +955,7 @@ namespace Microsoft.Build.Tasks
}
/// <summary>
/// Provide a mechanism to determine where the subset white lists are located by searching the target framework folders
/// Provide a mechanism to determine where the subset allow lists are located by searching the target framework folders
/// for a list of provided subset list names.
/// </summary>
internal class SubsetListFinder

Просмотреть файл

@ -1744,7 +1744,7 @@
<data name="ResolveAssemblyReference.TargetFrameworkSubsetLogHeader">
<value>TargetFramework Profile List Information:</value>
</data>
<data name="ResolveAssemblyReference.TargetFrameworkWhiteListLogHeader">
<data name="ResolveAssemblyReference.TargetFrameworkAllowListLogHeader">
<value>TargetFramework Profile List Paths:</value>
</data>
<data name="ResolveAssemblyReference.TargetFrameworkRedistLogHeader">

2
src/Tasks/Resources/xlf/Strings.cs.xlf сгенерированный
Просмотреть файл

@ -2120,7 +2120,7 @@
<target state="translated">Informace o seznamu profilu TargetFramework:</target>
<note />
</trans-unit>
<trans-unit id="ResolveAssemblyReference.TargetFrameworkWhiteListLogHeader">
<trans-unit id="ResolveAssemblyReference.TargetFrameworkAllowListLogHeader">
<source>TargetFramework Profile List Paths:</source>
<target state="translated">Cesty seznamu profilu TargetFramework:</target>
<note />

2
src/Tasks/Resources/xlf/Strings.de.xlf сгенерированный
Просмотреть файл

@ -2120,7 +2120,7 @@
<target state="translated">Informationen zur TargetFramework-Profilliste:</target>
<note />
</trans-unit>
<trans-unit id="ResolveAssemblyReference.TargetFrameworkWhiteListLogHeader">
<trans-unit id="ResolveAssemblyReference.TargetFrameworkAllowListLogHeader">
<source>TargetFramework Profile List Paths:</source>
<target state="translated">Pfade der TargetFramework-Profilliste:</target>
<note />

2
src/Tasks/Resources/xlf/Strings.es.xlf сгенерированный
Просмотреть файл

@ -2120,7 +2120,7 @@
<target state="translated">Información de listas de perfiles de TargetFramework:</target>
<note />
</trans-unit>
<trans-unit id="ResolveAssemblyReference.TargetFrameworkWhiteListLogHeader">
<trans-unit id="ResolveAssemblyReference.TargetFrameworkAllowListLogHeader">
<source>TargetFramework Profile List Paths:</source>
<target state="translated">Rutas de acceso de listas de perfiles de TargetFramework:</target>
<note />

2
src/Tasks/Resources/xlf/Strings.fr.xlf сгенерированный
Просмотреть файл

@ -2120,7 +2120,7 @@
<target state="translated">Informations de listes de profil TargetFramework :</target>
<note />
</trans-unit>
<trans-unit id="ResolveAssemblyReference.TargetFrameworkWhiteListLogHeader">
<trans-unit id="ResolveAssemblyReference.TargetFrameworkAllowListLogHeader">
<source>TargetFramework Profile List Paths:</source>
<target state="translated">Chemins d'accès de listes de profil TargetFramework :</target>
<note />

2
src/Tasks/Resources/xlf/Strings.it.xlf сгенерированный
Просмотреть файл

@ -2120,7 +2120,7 @@
<target state="translated">Informazioni sull'elenco di profili TargetFramework:</target>
<note />
</trans-unit>
<trans-unit id="ResolveAssemblyReference.TargetFrameworkWhiteListLogHeader">
<trans-unit id="ResolveAssemblyReference.TargetFrameworkAllowListLogHeader">
<source>TargetFramework Profile List Paths:</source>
<target state="translated">Percorsi dell'elenco di profili TargetFramework:</target>
<note />

2
src/Tasks/Resources/xlf/Strings.ja.xlf сгенерированный
Просмотреть файл

@ -2120,7 +2120,7 @@
<target state="translated">TargetFramework プロファイルのリスト情報:</target>
<note />
</trans-unit>
<trans-unit id="ResolveAssemblyReference.TargetFrameworkWhiteListLogHeader">
<trans-unit id="ResolveAssemblyReference.TargetFrameworkAllowListLogHeader">
<source>TargetFramework Profile List Paths:</source>
<target state="translated">TargetFramework プロファイルのリストのパス:</target>
<note />

2
src/Tasks/Resources/xlf/Strings.ko.xlf сгенерированный
Просмотреть файл

@ -2120,7 +2120,7 @@
<target state="translated">TargetFramework 프로필 목록 정보:</target>
<note />
</trans-unit>
<trans-unit id="ResolveAssemblyReference.TargetFrameworkWhiteListLogHeader">
<trans-unit id="ResolveAssemblyReference.TargetFrameworkAllowListLogHeader">
<source>TargetFramework Profile List Paths:</source>
<target state="translated">TargetFramework 프로필 목록 경로:</target>
<note />

2
src/Tasks/Resources/xlf/Strings.pl.xlf сгенерированный
Просмотреть файл

@ -2120,7 +2120,7 @@
<target state="translated">Informacje o liście profilów TargetFramework:</target>
<note />
</trans-unit>
<trans-unit id="ResolveAssemblyReference.TargetFrameworkWhiteListLogHeader">
<trans-unit id="ResolveAssemblyReference.TargetFrameworkAllowListLogHeader">
<source>TargetFramework Profile List Paths:</source>
<target state="translated">Ścieżki listy profilów TargetFramework:</target>
<note />

2
src/Tasks/Resources/xlf/Strings.pt-BR.xlf сгенерированный
Просмотреть файл

@ -2120,7 +2120,7 @@
<target state="translated">Informações da Lista de Perfis TargetFramework:</target>
<note />
</trans-unit>
<trans-unit id="ResolveAssemblyReference.TargetFrameworkWhiteListLogHeader">
<trans-unit id="ResolveAssemblyReference.TargetFrameworkAllowListLogHeader">
<source>TargetFramework Profile List Paths:</source>
<target state="translated">Caminhos da Lista de Perfis TargetFramework:</target>
<note />

2
src/Tasks/Resources/xlf/Strings.ru.xlf сгенерированный
Просмотреть файл

@ -2120,7 +2120,7 @@
<target state="translated">Данные списка профилей TargetFramework:</target>
<note />
</trans-unit>
<trans-unit id="ResolveAssemblyReference.TargetFrameworkWhiteListLogHeader">
<trans-unit id="ResolveAssemblyReference.TargetFrameworkAllowListLogHeader">
<source>TargetFramework Profile List Paths:</source>
<target state="translated">Пути к списку профилей TargetFramework:</target>
<note />

2
src/Tasks/Resources/xlf/Strings.tr.xlf сгенерированный
Просмотреть файл

@ -2120,7 +2120,7 @@
<target state="translated">TargetFramework Profil Listesi Bilgisi:</target>
<note />
</trans-unit>
<trans-unit id="ResolveAssemblyReference.TargetFrameworkWhiteListLogHeader">
<trans-unit id="ResolveAssemblyReference.TargetFrameworkAllowListLogHeader">
<source>TargetFramework Profile List Paths:</source>
<target state="translated">TargetFramework Profil Listesi Yolları:</target>
<note />

2
src/Tasks/Resources/xlf/Strings.xlf сгенерированный
Просмотреть файл

@ -1511,7 +1511,7 @@
<source>TargetFramework Profile List Information:</source>
<note />
</trans-unit>
<trans-unit id="ResolveAssemblyReference.TargetFrameworkWhiteListLogHeader">
<trans-unit id="ResolveAssemblyReference.TargetFrameworkAllowListLogHeader">
<source>TargetFramework Profile List Paths:</source>
<note />
</trans-unit>

2
src/Tasks/Resources/xlf/Strings.zh-Hans.xlf сгенерированный
Просмотреть файл

@ -2120,7 +2120,7 @@
<target state="translated">TargetFramework 配置文件列表信息:</target>
<note />
</trans-unit>
<trans-unit id="ResolveAssemblyReference.TargetFrameworkWhiteListLogHeader">
<trans-unit id="ResolveAssemblyReference.TargetFrameworkAllowListLogHeader">
<source>TargetFramework Profile List Paths:</source>
<target state="translated">TargetFramework 配置文件列表路径:</target>
<note />

2
src/Tasks/Resources/xlf/Strings.zh-Hant.xlf сгенерированный
Просмотреть файл

@ -2120,7 +2120,7 @@
<target state="translated">TargetFramework 設定檔清單資訊:</target>
<note />
</trans-unit>
<trans-unit id="ResolveAssemblyReference.TargetFrameworkWhiteListLogHeader">
<trans-unit id="ResolveAssemblyReference.TargetFrameworkAllowListLogHeader">
<source>TargetFramework Profile List Paths:</source>
<target state="translated">TargetFramework 設定檔清單資路徑:</target>
<note />

Просмотреть файл

@ -1,4 +1,4 @@
// Licensed to the .NET Foundation under one or more agreements.
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
using System;
@ -1398,7 +1398,7 @@ namespace Microsoft.Build.Utilities
string batchFileForCommandLine = _temporaryBatchFile;
// If for some crazy reason the path has a & character and a space in it
// If for some reason the path has a & character and a space in it
// then get the short path of the temp path, which should not have spaces in it
// and then escape the &
if (batchFileForCommandLine.Contains("&") && !batchFileForCommandLine.Contains("^&"))