tunnelvisionlabs / ReferenceAssemblyAnnotator

IL weaver to add nullability annotations to .NET reference assemblies
MIT License
71 stars 8 forks source link

'AllowNullAttribute::.ctor()' is declared in another module and needs to be imported #44

Closed jnm2 closed 5 years ago

jnm2 commented 5 years ago

@sharwell We missed something in https://github.com/tunnelvisionlabs/ReferenceAssemblyAnnotator/pull/43.

The "AnnotatorBuildTask" task failed unexpectedly.
System.ArgumentException: Member 'System.Void System.Diagnostics.CodeAnalysis.AllowNullAttribute::.ctor()' is declared in another module and needs to be imported
   at Mono.Cecil.MetadataBuilder.LookupToken(IMetadataTokenProvider provider)
   at Mono.Cecil.MetadataBuilder.AddCustomAttributes(ICustomAttributeProvider owner)
   at Mono.Cecil.MetadataBuilder.AddParameter(UInt16 sequence, ParameterDefinition parameter, ParamTable table)
   at Mono.Cecil.MetadataBuilder.AddParameters(MethodDefinition method)
   at Mono.Cecil.MetadataBuilder.AddMethod(MethodDefinition method)
   at Mono.Cecil.MetadataBuilder.AddMethods(TypeDefinition type)
   at Mono.Cecil.MetadataBuilder.AddType(TypeDefinition type)
   at Mono.Cecil.MetadataBuilder.AddTypes()
   at Mono.Cecil.MetadataBuilder.BuildTypes()
   at Mono.Cecil.MetadataBuilder.BuildModule()
   at Mono.Cecil.MetadataBuilder.BuildMetadata()
   at Mono.Cecil.ModuleWriter.<>c.<BuildMetadata>b__2_0(MetadataBuilder builder, MetadataReader _)
   at Mono.Cecil.ModuleDefinition.Read[TItem,TRet](TItem item, Func`3 read)
   at Mono.Cecil.ModuleWriter.BuildMetadata(ModuleDefinition module, MetadataBuilder metadata)
   at Mono.Cecil.ModuleWriter.Write(ModuleDefinition module, Disposable`1 stream, WriterParameters parameters)
   at Mono.Cecil.ModuleWriter.WriteModule(ModuleDefinition module, Disposable`1 stream, WriterParameters parameters)
   at Mono.Cecil.ModuleDefinition.Write(String fileName, WriterParameters parameters)
   at TunnelVisionLabs.ReferenceAssemblyAnnotator.Program.Main(Nullable`1 log, String referenceAssembly, String annotatedReferenceAssembly, String outputAssembly)
   at TunnelVisionLabs.ReferenceAssemblyAnnotator.AnnotatorBuildTask.Execute()
   at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
   at Microsoft.Build.BackEnd.TaskBuilder.ExecuteInstantiatedTask(ITaskExecutionHost taskExecutionHost, TaskLoggingContext taskLoggingContext, TaskHost taskHost, ItemBucket bucket, TaskExecutionMode howToExecuteTask)

https://dev.azure.com/guorg/Gu.Roslyn.Extensions/_build/results?buildId=332&view=logs&jobId=12f1170f-54f2-53f3-20dd-22fc7dff55f9&taskId=006e6f7c-8314-5e02-a3df-483f3a1f4cfa&lineStart=15&lineEnd=37&colStart=1&colEnd=474