Skip to content

Commit

Permalink
Clarify comment about MSBuildLoadContext test
Browse files Browse the repository at this point in the history
The confusing situation can be resolved by an IVT change, filed as #5041.
  • Loading branch information
rainersigwald committed Jan 9, 2020
1 parent 6d4c3b1 commit f561312
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/MSBuild.UnitTests/ValidateAssemblyLoadContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,11 @@ public override bool Execute()
{
var thisLoadContext = AssemblyLoadContext.GetLoadContext(typeof(ValidateAssemblyLoadContext).Assembly);

// Check by name because this always reports false, presumably due to ALC shenanigans:
// if (thisLoadContext is MSBuildLoadContext context)
// The straightforward implementation of this check:
// if (thisLoadContext is MSBuildLoadContext context)
// fails here because MSBuildLoadContext (in this test assembly) is from MSBuild.exe via
// IVT, but the one that actually gets used for task isolation is in Microsoft.Build.dll.
// This probably doesn't need to be how it is forever: https://github.com/microsoft/msbuild/issues/5041
if (thisLoadContext.GetType().FullName == typeof(MSBuildLoadContext).FullName)
{
#if NETCOREAPP && !NETCOREAPP2_1 // TODO: enable this functionality when targeting .NET Core 3.0+
Expand Down

0 comments on commit f561312

Please sign in to comment.