Closed realvizu closed 7 years ago
It turned out that it had nothing to do with running msbuild in parallel mode but some other msbuild task was loaded into the AppDomain that interfered with the assembly binding redirection implementation in NsDepCopTask. Changing NsDepCopTask to AppDomainIsolatedTask fixed the problem but at a cost of performance :(
Exception in NsDepCopTask:
System.MissingMethodException: „System.Collections.Immutable.ImmutableArray`1 System.Reflection.Metadata.MetadataReader.GetBlobContent(System.Reflection.Metadata.BlobHandle)”.
at: Microsoft.CodeAnalysis.MetadataReaderExtensions.CreateAssemblyIdentityOrThrow(MetadataReader reader, Version version, AssemblyFlags flags, BlobHandle publicKey, StringHandle name, StringHandle culture, Boolean isReference)
...
Microsoft (R) Build Engine version 15.1.1012.6693 Happens only when msbuild runs in parallel mode (/m).
Checked the loaded modules in VS debugger and the correct version of System.Reflection.Metadata is loaded (1.2.1.0, 4.6.24816.1) and the GetBlobContent method is definitely not missing.