0
votes

I am in the process of upgrading a project to .NET 4.0 and I get this error when I try and build the solution: Invalid argument. Parameter "ItemSpec" cannot be null. c:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets 1558 9

Is there a way to find out what is being passed as null to the ResolveComReference task?

1

1 Answers

0
votes

Try this; temporarily add the following to the project file that is failing:

<Target Name="DiagnoseNullItems"
   BeforeTargets="ResolveComReferences"
   AfterTargets="ResolveAssemblyReferences">
   <Message Importance="High" Text="COMReference is '@(COMReference)'" />
   <Message Importance="High" Text="COMFileReference is '@(COMFileReference)'" />
   <Message Importance="High" Text="ReferencePath is '@(ReferencePath)'" />
   <Message Importance="High" Text="_ResolveComReferenceCache is '@(_ResolveComReferenceCache)'" />
</Target>

I think that is all of them, unless some of the other $() arguments to that task are also of type ITaskItem. If that doesn't reveal an empty item, do the same for the properties passed to the ResolveComReference task.